Jump to content

DEFINE_ACTION_FUNCTION function RET ~string~ ... ??


subtledoctor

Recommended Posts

I'd like to do something like this:

DEFINE_ACTION_FUNCTION choose_tra RET ~chosen_tra~ BEGIN
  [codey stuff]
  ACTION_IF (VARIABLE_IS_SET %detected_lang%) BEGIN
    OUTER_SPRINT chosen_tra ~%detected_lang%~
  END
  ACTION_IF !(VARIABLE_IS_SET %detected_lang%) BEGIN
    OUTER_SPRINT chosen_tra ~en_US~
  END
END

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

DEFINE_ACTION_FUNCTION install_component BEGIN

  LAF choose_tra RET tra_to_use = ~chosen_tra~ END

  WITH_TRA ~%MOD_FOLDER%/lang/%tra_to_use%/stuff.tra~ BEGIN

    [do stuff]

  END

END

I've only ever seen RET used in mods or in the Weidu documentation to return an integer - not a string. Can it work this way?  (Is RET even needed?  Could I just run the function to SPRINT the string and then use that variable?)

Thx.

Edited by subtledoctor
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

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

×
×
  • Create New...