Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why this code doesn't work?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00839067
Message ID:
00839109
Views:
32
This message has been marked as the solution to the initial question of the thread.
Hi Selim,

The only reason to use #define constants is to make the code readable. You don't need to convert parameter value back to the #define constants. Use them when you assign values to the array items and than just pass that item (numeric) to the method. For the COM object method call there's no difference between #1 and #2, but #1 is readable when #2 is not.
#define WLNORMAL  2
#define WLREVERSE 3
* #1
oRF.Print(0,0,"just a test",WLCLEAR+WLNORMAL)
* #2
oRF.Print(0,0,"just a test",5)
See corrections inline.

>I do need to store the constants to a string because is something that doesn't run inmediatly. It is something I need to store in an array or collection and then process all together something like this
>
>What i am doing is building a screen. I have a method to add lines to the screen first, after the programmer have added all the lines that'll be on the screen then I have another method to display the screen.
>
>it is not this but this is the main idea
>
>
>Local lnRow, lnCol, lcMess, lcMode
>DECLARE arrLines[3,4]
>arrLines[1,1]=0
>arrLines[1,2]=0
>arrLines[1,3]='Fisrt Line'
 arrLines[1,4]=WLREVERSE+WLCLEAR
>
>arrLines[2,1]=1
>arrLines[2,2]=0
>arrLines[2,3]='Second Line'
 arrLines[2,4]=WLNORMAL+WLCLEAR
>
>arrLines[3,1]=2
>arrLines[3,2]=0
>arrLines[3,3]='Last Line'
 arrLines[3,4]=WLNORMAL+WLFLUSHOUT
>
>FOR _N = 1 to 3
>   lnRow = arrLines[_N,1]
>   lnCol = arrLines[_N,2]
>   lcMess= arrLines[_N,3]
    lnMode= arrLines[_N,4]
    oRF.Print(lnCol,lnRow,lcMess, lnMode)
>ENDFOR
>
>
>see what I need?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform