Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MENU:ERROR OF SYNTAX

Status
Not open for further replies.

midou

Programmer
Oct 20, 2002
24
FR
Hi!
I use this code to display menu from programm:
[Set filter to profil="AGENT"
Set order to xsitem
Go top
j=1,i=1,m=space(6)
Do while !eof( )
If item =space (6)
k=str(j)
Define PAD &k OF _MSYSMENU PROMPT tree.nom
On PAD &k OF _MSYSMENU ACTIVATE POPUP tree.nom
Define POPUP &tree.nom MARGIN RELATIVE COLOR SCHEME 4
m=tree.sitem
j=j+1
Endif
If tree.nom=m
h=str(i)
Define BAR &h OF &k PROMPT tree.nom
Endif
i=i+1
Skip
Enddo]
I'd like to display the contents of the variable j and i, but i have any error tell me "syntax error".
can some one help me please?
 
First of all:

Do while !eof( ) is not a good practice of coding...;-)

When I used this in the past, my code was immediately returned, and I had to correct it.

Use SCAN ENDSCAN instead.

DEFINE PAD needs a name and not a number.

Define PAD 1 OF _MSYSMENU PROMPT tree.nom, gives you the syntax error.

it is also a better practice of giving a usefull name, that lets the reader of the code know what is meant.

Something like:

Define PAD MAINTFORM_ITEMS OF _MSYSMENU PROMPT tree.nom, would say more than some number.

Good luck,

HTH,
Weedz (Wietze Veld)
My private project:CrownBase source code can be downloaded !!
 
Try
- each command one line
j=1
i=1 ...
- k=alltrim(str(j))...
- instead do while, skip and enddo try scan/endscan
- good idea not start each command from first
positinon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top