×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

MENU:ERROR OF SYNTAX

MENU:ERROR OF SYNTAX

MENU:ERROR OF SYNTAX

(OP)
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?

RE: MENU:ERROR OF SYNTAX

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:www.crowncap.demon.nl\info\crwnbase
CrownBase source code can be downloaded !!

RE: MENU:ERROR OF SYNTAX

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...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close