Jump to content
  • 0

= operator to assign variables not working if variable is getarg


Question

Posted (edited)

I can do this:

if (!getarg(1)) set getarg(1), $@warpwaitingpc[0];

But I can't do this:

if (!getarg(1)) getarg(1) = $@warpwaitingpc[0];

parse_line: expected ';'

 

Intended behaviour? I thought 'set' was no longer needed in any context.

Edited by Leeg

4 answers to this question

Recommended Posts

  • 0
Posted

I have no idea how this even worked for you in the first place...

getarg() is a function, not a variable, you just cannot set a value, it just gets the value you passed when calling the function.

you need a variable

.@i = getarg(1);
if (!.@i) .@i = $@warpwaitingpc[0];

 

  • Upvote 1
  • 0
Posted (edited)

in your case, you have to use the set() script command.

if (!getarg(1)) set getarg(1), $@warpwaitingpc[0];

if I recall correctly this should be the case.

Edited by Emistry

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...