×
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

ASSIGMENT error in IF condition

ASSIGMENT error in IF condition

ASSIGMENT error in IF condition

(OP)
IF TYPEUN = "FGPVC 1" .OR. TYPEUN = "FGPVC 2" .OR. TYPEUN = "FGPVC 3" .OR. TYPEUN = "FGPVC 4" .OR. TYPEUN = "FGPVC 5" .OR. TYPEDEUX = "FGPVC 2L" .OR. TYPEDEUX = "FGPVC 3L" .OR. TYPETROIS = "FGPVC 3LB" .OR. TYPEDEUX = "FGPVC 3A" .OR. TYPEDEUX = "FGPVC 4A" .OR. TYPEDEUX = "FGPVC 5A" .OR. TYPEDEUX = "FGPVC 10" .OR. TYPETROIS = "FGPVC 10B" .OR. TYPETROIS = "FGPVC 10C" .OR. TYPETROIS = "FGPVC 20B"

This is my IF condition.

When I try to build I get an ASSIGMENT error on this line.

There is something wrong in my syntax ?

Thank you for your help.

RE: ASSIGMENT error in IF condition

Salut, jfdumais

It looks like the resulting statement is just too long.
I got it to work by splitting up the statement using semicolons:

IF TYPEUN = "FGPVC 1" .OR. TYPEUN = "FGPVC 2" .OR. TYPEUN = "FGPVC 3" .OR.;
 TYPEUN = "FGPVC 4" .OR. TYPEUN = "FGPVC 5" .OR. TYPEDEUX = "FGPVC 2L" .OR.;
 TYPEDEUX = "FGPVC 3L" .OR. TYPETROIS = "FGPVC 3LB" .OR.;
 TYPEDEUX = "FGPVC 3A" .OR. TYPEDEUX = "FGPVC 4A" .OR. TYPEDEUX = "FGPVC 5A" .OR.;
 TYPEDEUX = "FGPVC 10" .OR. TYPETROIS = "FGPVC 10B" .OR.;
 TYPETROIS = "FGPVC 10C" .OR. TYPETROIS = "FGPVC 20B"
? 'Oui'
else
? 'Non'
endif

However, I have to say I would do something like:

if typeun$"FGPVC 1  \FGPVC 2  \...\FGPVC 5  " ;
   .or. typedeux$"FGPVC 2L \...\FGPVC 10 ";
   .or. typetrois$" ... etc

for improved readability and to shorten the line. However the strings you are testing for would each have to be padded out to len(typex), which I have assumed to be 9 bytes.

Jock

RE: ASSIGMENT error in IF condition

I *think* you are limited to about 16 conditions (it's a bit like recursion).

Regards

Griff
Keep Smileing

RE: ASSIGMENT error in IF condition

(OP)
Good I split it and it work fine !

Thanks a lot

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