Results 1 to 3 of 3

Thread: iif function

  1. #1

    iif function

    well one day soon I hope to complete a day of testing without having to bother you all. :/

    so i am running thru a set of properties in the init of a class that creates my menu form. the form is properly created and modified in vfp. this case is to resize and move objects which may or maynot be needed in the end but the example repeats in many other places doing different things so i need to figure it out.

    I simplified the first error occurance and it works so the problem wouuld seem to be with the iif Ive read all the docs I can find and no clue.

    line creating the error

    thisform.controls(X1).LEFT=IIF(THISFORM.CONTROLS(X 1).TAG=' ',thisform.controls(X1).LEFT*M.SCRSZ,thisform.cont rols(X1).LEFT)

    error:

    Fri Jan 10 13:47:29 2014
    **** Lianja error ****
    thisform.controls(X1).LEFT=IIF(THISFORM.CONTROLS(X 1).TAG=' ',thisform.controls(X1).LEFT*M.SCRSZ,thisform.cont rols(X1).LEFT)
    ^
    Comma was expected
    Called from program - mnu1.init() at line 84
    Called from program - menu.dbo at line 49
    Called from program - start.dbo at line 215

    TIA

    Jim
    Last edited by Quailco; 2014-01-10 at 16:46. Reason: correction

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Hi Jim,

    Not quite sure why this is getting an error (you can Submit a ticket for further investigation), but if you create a reference for the control, the error is not occurring, e.g.

    Code:
    ...
    oCurrctrl = thisform.controls(X1)
    oCurrctrl.LEFT=IIF(empty(oCurrctrl.TAG),oCurrctrl.LEFT*M.SCRSZ,oCurrctrl.LEFT)
    ...
    Regards,

    Yvonne

  3. #3
    Thanks Yvonne

    I will make a note to look at submitting a ticket but for the moment using an object reference is a great work around.

    Jim

    Ps thought i posted this response but maybe i was in a hurry an muffed it.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us