Syntax error - Operand not valid as destination

Author: lalitpct@gmail.com (lalitpct)

Hi All,

For below piece of code I am getting syntax error in 9.4 even though same code is working fine in 8.4

$user = ""  and $user = "%%$2"  is giving compilation error in 9.4 and 8.4 compiles it without error.

Error is  error: 1000 - Syntax error (Operand not valid as destination) (APPL) 6-1 $user = "%%$2" (APPL)

 

Entire code

--------------

$variation

= 'SMART'

$keyboard

= 'PCTERM'

$user

= ""                                                                                ---------------------------------------------------------------------->Error

if

$$func_id =

 

 

($2 != "") & ($gui = 'CHR') "%%$2"$user = "%%$2"                                                                             ---------------------------------------------------------------------->Error putmess "Hello $user = %%$user, $gui is %%$gui, $2 is %%$2, $4 is %%$4"

else

message

 

/error "No batch id passed for character SmartII. Call SmartII Support"return(-1)

endif

if

$$timecount = 0

$$sys_user_id = 0

 

 

 

 

 

 

call

 

 

 

 

 

 

endif

exit

 

 

 

($4 = "")if ($gui != 'CHR')$keyboard = 'GUIKEYS'run 'servers'endifget_sys_user_idactivate "menu"if ($status < 0)message/error "Unable to run the menu. Please contact SmartII Support. %%$procerrorcontext"return(-1)endif

;----------------------------------------------------------------------------

entry

get_sys_user_id

;----------------------------------------------------------------------------

;

; Check that the user exists in the USERS table and load the system variables

; $$sys_user_id loaded from the user_id in the users table here.

;; ---------------------------------------------------------------------------

if

$1 = $$user

($$db_user = "")

else

 

 

$1 = $$db_useruppercase $1, $1

endif

$result

= ""

sql

"select upper('%%$1')","STA"

if

 

 

$$sys_user_id =

 

return

 

else

return

($result != "")sql "select user_id from users where name = '%%$result'","$STA"if ($result != "")$resultelse(-1)endif(-1)

endif

end

 

 Error meessage in compilation  

 

Compile Startup Shell: 'SMART' Startup Shell: SMART Phase 1: Start-up Shell Properties Phase 2: Procs compilation (APPL) 3 $user = "" (APPL)

error: 1000 - Syntax error (Operand not valid as destination) (APPL) 6-1 $user = "%%$2" (APPL)

error: 1000 - Syntax error (Operand not valid as destination) error: 1112 - Total Proc compile errors: 2. phase completed with error-code -1 1113 -

****** NO NEW APPLICATION CREATED ******* error: 1008 - Start-up shell compilation stopped due to compilation errors. Compile done: [info 0, warnings 0, errors 3]

3 Comments

  1. Hi Lalipct You can't set $user ! Ingo


    Author: istiller (i2stiller@gmx.de)
  2. but on 8.4 its not giving any error see below application log on 8.4 and there it has been set as null ,

    is it that has been removed in 9.4

     

    (APPL) APPL:1  $variation = 'SMART'                                           x
    x(APPL) APPL:2  $keyboard = 'PCTERM'                                           x
    x(APPL) APPL:3  $user = ""                                                     x                                           --------------------------------------->set as null
    x(APPL) APPL:4  putmess "$user = %%$user, $gui is %%$gui, $2 is %%$2, $4 is %%$x
    x$user = ld78977, $gui is CHR, $2 is smt2uxb, $4 is                            x
    x(APPL) APPL:5  if ($2 != "" & $gui = 'CHR')                                   x
    x(APPL) APPL:6  $$FUNC_ID = "%%$2"                                             x
    x(APPL) APPL:10  endif                                                         x
    x(APPL) APPL:11  if ($4 = "")                                                  x
    x(APPL) APPL:12  $$TIMECOUNT = 0                                               x
    x(APPL) APPL:13  $$SYS_USER_ID = 0                                             x
    x(APPL) APPL:14  fileload "settings.ini", $48                                  x
    x(APPL) APPL:15  [-4] scan $48, "automessages=1"                               x
    x(APPL) APPL:16  [-4] if ($result > 0)                                         x
    x(APPL) APPL:18  [-4] else                                                     x
    mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

     


    Author: lalitpct (lalitpct@gmail.com)
  3. Hi

    From ulibrary :

    Return the user name used to log on to a path.

    And not "Return or set", so you used  an undocumented feature of the 8.4 (maybe a bug or an opendoor for Compuware's developers).
    I'm the first user of undocumented features ($tometa), but you can't contest their removal (even if some times, it's raging).

    Kind regards,
    Richard

     


    Author: richard.gill (richard.gill@agfa.com)