Alaska Software Inc. - Call command
Username: Password:
AuthorTopic: Call command
Frankie Call command
on Tue, 23 May 2006 21:28:26 +0800
Hi all,

How do i convert the not supported "Call" command to xbase?

Is this convertion correct ? 
Call DBARCODE with cString -> DBARCODE(cString)

In addition, how do i link a clipper object to xbase? I only have the
object file and the command 'DBARCODE' is in the obj file.

In clipper, i compile the prgs to became objs and then link it with
DBARCODE obj file. For example, 

clipper M
if not errorlevel 1 rtlink file M,DBARCODE


Does anyone has a solution?

TIA


Frankie


DBARCODE.OBJ
Regan Cawkwell Re: Call command
on Tue, 23 May 2006 14:57:05 +0100
Hi Frankie

Frankie wrote:
> Hi all,
> 
> How do i convert the not supported "Call" command to xbase?
> 
> Is this convertion correct ? 
> Call DBARCODE with cString -> DBARCODE(cString)
> 
> In addition, how do i link a clipper object to xbase? I only have the
> object file and the command 'DBARCODE' is in the obj file.
> 
> In clipper, i compile the prgs to became objs and then link it with
> DBARCODE obj file. For example, 
> 
> clipper M
> if not errorlevel 1 rtlink file M,DBARCODE
> 
> 
> Does anyone has a solution?

The quick answer is that you can't do this in the way that you are 
trying to...

You would be better finding a replacement for the functionality of this 
DBARCODE module and use that instead.

If you give some idea of what DBARCODE actually does, someone might 
point you in the direction of something else that will do the same thing...

Regan Cawkwell
Company  : Real Business Applications Ltd
Title    : Technical Support
Websites : www.rbauk.com   www.rba-uk.com   www.retailerexpress.co.uk
Email    : regan@rba-uk.com
------------------------------------------------------
Frankie Re: Call command
on Tue, 23 May 2006 22:48:59 +0800
Hi Regan
> 
> The quick answer is that you can't do this in the way that you are 
> trying to...
> 
> You would be better finding a replacement for the functionality of this 
> DBARCODE module and use that instead.
> 
> If you give some idea of what DBARCODE actually does, someone might 
> point you in the direction of something else that will do the same thing...

Thanks for the quick answer. I know it's a dead end but just hoping for a
miracle.

The module print barcode from a formatted string 'q' and the product code. 

I have another barcode printing module but only in gui app. I just wanted
to convert this clipper app to xbase non gui because the data has grown big
and became unstable and also there are minor changes of request but i wish
to do it in xbase if possible.

Looks like i have no luck but to go back to clipper.... 

Regards


Frankie
Gale Ford Re: Call command
on Tue, 23 May 2006 14:07:45 -0500
Frankie wrote:
> Hi Regan
>> The quick answer is that you can't do this in the way that you are 
>> trying to...
>>
>> You would be better finding a replacement for the functionality of this 
>> DBARCODE module and use that instead.
>>
>> If you give some idea of what DBARCODE actually does, someone might 
>> point you in the direction of something else that will do the same thing...
> 
> Thanks for the quick answer. I know it's a dead end but just hoping for a
> miracle.
> 
> The module print barcode from a formatted string 'q' and the product code. 
> 
> I have another barcode printing module but only in gui app. I just wanted
> to convert this clipper app to xbase non gui because the data has grown big
> and became unstable and also there are minor changes of request but i wish
> to do it in xbase if possible.
> 
> Looks like i have no luck but to go back to clipper.... 
> 
> Regards
> 
> 
> Frankie
> 
> 
Can't you use a barcode printer font with xbase non-gui?
It will still be using Microsoft Windows?
Frankie Re: Call command
on Wed, 24 May 2006 12:12:00 +0800
Hi Gale

> Can't you use a barcode printer font with xbase non-gui?
> It will still be using Microsoft Windows?

How do i do that? Can u provide to me some sample?


TIA

Frankie
Gale Ford Re: Call command
on Wed, 24 May 2006 11:12:04 -0500
Frankie wrote:
> Hi Gale
> 
>> Can't you use a barcode printer font with xbase non-gui?
>> It will still be using Microsoft Windows?
> 
> How do i do that? Can u provide to me some sample?
> 
> 
> TIA
> 
> Frankie
If you are new to xBase++ and windows I would recommend pagescript32
It is in beta but it is very easy to use and there is a version for 
Clipper and xBase++.
You can download beta here
http://www.abeelabs.com/en/ps32/index.html

Here is a sample that would print out "Hello world" and print a 3of9 
barcode that is 1 inch tall.

#Include "PScript.ch"
  if PSInit() == 0
     BEGINDOC USING 0 TITLE "Hello world"
        PSSetUnit(APS_TEXT)
        PSSetLPI(6)
        PSSetCPI(10)
        @5,5 TEXTOUT "Hello world"
        PSBarCode(10, 5, '1234567890', 72,,,APS_BC39 )
     ENDDOC
  endif
Joe Carrick Re: Call command
on Wed, 24 May 2006 14:06:26 -0700
Hi Frankie,

Even if the App is non-gui, you should be able to use the windows 
barcode printing module.  You might need to link in hybrid mode, but 
that's just so the screens work, it shouldn't make any difference to the 
windows printing routine.

Following is code I use to print barcodes and I don't see any reason it 
would not work for you with a little modification.  This code prints
labels (2 wide) on a deskjet or laserjet printer.

**************************************************************************
****** Print the Barcode
   IF lPrint
     oPrinterPS  := PrinterPS()	 PrinterPS is a function that returns
                                  a Printer Presentation Space
     IF empty(oPrinterPS)
       lPrint := .F.
     ENDIF
   ENDIF

    oCb1, oCb2, oRad1 & oSpn are just Xbp's that have dataLinks to
    indicate what data is to be printed.  In this particular code it
    refers to:
    oCb1 & oCb2 (ComboBoxes)with Inventory Items listed.
    oRad1 is a set of radio buttons specifying special formatting.
    oSpn is a Spinbutton to specify the number of labels to print.

   IF lPrint
     IF oCb1:getdata()[1] > oCb2:getdata()[1]
       oCb2:setdata(oCb1:getdata()[1])
     ENDIF

     cInitials := upper(left(cCompanyName,1)+;
                  substr(cCompanyName,at(" ",cCompanyName)+1,1)+;
                  substr(cCompanyName,rat(" ",cCompanyName)+1,1))

      MxProperString simply capitalizes all words in a string.
     cCompanyName := MxProperString(IIf(oChk:selection,cCompanyName,""))

     FOR j := oCb1:getdata()[1] TO oCb2:getdata()[1]

       cItemno := aItems[j]
       cItemNo := IIf(oRad1:getdata(),cItemNo,left(cItemno,15)+cInitials)

       oFontArial	:= XbpFont():new(oPrinterPS)
       oFontArial:create("12.Arial Bold")

       oFont39		:= XbpFont():new(oPrinterPS)
       oFont39:create("32.Free 3 of 9")

       aAttr := Array( GRA_AS_COUNT )
       aAttr [ GRA_AS_HORIZALIGN ] :=  GRA_HALIGN_CENTER
       GraSetAttrString( oPrinterPS, aAttr )

       nY := 2550

       oPrinterPS:device():startDoc()
       FOR i := 1 TO oSpn:getdata()/2
         GraSetFont(oPrinterPS, oFontArial)
         GraStringAt(oPrinterPS, { 510,nY}, cCompanyName )
         GraStringAt(oPrinterPS, {1540,nY}, cCompanyName )

         GraStringAt(oPrinterPS, { 510,nY-160}, cItemNo )
         GraStringAt(oPrinterPS, {1540,nY-160}, cItemNo )

         GraSetFont(oPrinterPS, oFont39)
         GraStringAt(oPrinterPS,;
                     { 510,nY-110},;
                     "*"+StrTran(cItemno," ","_")+"*" )
         GraStringAt(oPrinterPS,;
                     {1540,nY-110},;
                     "*"+StrTran(cItemno," ","_")+"*" )
         nY := nY-254
       NEXT i
       oPrinterPS:device():enddoc()
     NEXT j
     oPrinterPS:destroy()

   ENDIF
**************************************************************************************

-Joe


Frankie wrote:
> Hi Regan
> 
>>The quick answer is that you can't do this in the way that you are 
>>trying to...
>>
>>You would be better finding a replacement for the functionality of this 
>>DBARCODE module and use that instead.
>>
>>If you give some idea of what DBARCODE actually does, someone might 
>>point you in the direction of something else that will do the same thing...
> 
> 
> Thanks for the quick answer. I know it's a dead end but just hoping for a
> miracle.
> 
> The module print barcode from a formatted string 'q' and the product code. 
> 
> I have another barcode printing module but only in gui app. I just wanted
> to convert this clipper app to xbase non gui because the data has grown big
> and became unstable and also there are minor changes of request but i wish
> to do it in xbase if possible.
> 
> Looks like i have no luck but to go back to clipper.... 
> 
> Regards
> 
> 
> Frankie
> 
>
Pablo BotellaRe: Call command
on Wed, 24 May 2006 22:10:51 +0200
Hi,

> How do i convert the not supported "Call" command to xbase?
> In addition, how do i link a clipper object to xbase? I only have the
> object file and the command 'DBARCODE' is in the obj file.
The trouble with this OBJ is that seems to be a 16 bit OBJ, so cannot be 
linked into a 32 bit program.

Still there a possible solution, but is a bit complex. Build a 16 bit 
windows executable including your 16 bit OBJ. Create a hidden receiver 
window and use the WM_COPYDATA dispatcher to call your 16 bit function. From 
your 32 bit app you just need to send a WM_COPYDATA message to the 16 bit 
window providing your string parameter.

I think that will be better if you can found a 32 bit replacement, and use 
this 32->16 system only when no other solution.

Regards,
Pablo Botella
Frankie Re: Call command
on Thu, 25 May 2006 17:49:56 +0800
On Tue, 23 May 2006 21:28:26 +0800, Frankie wrote:

Hi Gale, Joe & Pablo

After reading your suggestions, i guess i've found a easier solution. But i
will put the suggestions in good use later.

I will just compile that barcode printing module in clipper exe. Then
compile the rest in xbase and use runshell to call the clipper exe.

At a result i do not need to create a new module and therefore cut down the
migration period. I think it will work.

Thanks guy


Regards

Frankie
Brent Dubs Re: Call command
on Fri, 26 May 2006 16:38:10 -0500
> I will just compile that barcode printing module in clipper exe. Then
> compile the rest in xbase and use runshell to call the clipper exe.


That might work.....until you run it on Windows Vista in a couple years 
and then it won't. Vista won't run 16-bit apps.

-Brent
Frankie Re: Call command
on Mon, 29 May 2006 10:21:38 +0800
On Fri, 26 May 2006 16:38:10 -0500, Brent Dubs wrote:

Thanks Brent,

I will take note on that and inform my client to upgrade the app to xbase
later.


>> I will just compile that barcode printing module in clipper exe. Then
>> compile the rest in xbase and use runshell to call the clipper exe.
> 
> 
> That might work.....until you run it on Windows Vista in a couple years 
> and then it won't. Vista won't run 16-bit apps.
> 
> -Brent
Frankie Re: Call command
on Mon, 29 May 2006 10:22:54 +0800
Hi Brent, 

Sorry, it should be upgrade to xbase gui later.

Regards

Frankie


On Fri, 26 May 2006 16:38:10 -0500, Brent Dubs wrote:

>> I will just compile that barcode printing module in clipper exe. Then
>> compile the rest in xbase and use runshell to call the clipper exe.
> 
> 
> That might work.....until you run it on Windows Vista in a couple years 
> and then it won't. Vista won't run 16-bit apps.
> 
> -Brent