Author Topic: PATCH_IF (SOURCE_SIZE > ~0x71~) ?  (Read 611 times)

Offline agb1

  • Planewalker
  • *****
  • Posts: 30
PATCH_IF (SOURCE_SIZE > ~0x71~) ?
« on: February 08, 2016, 08:08:19 PM »
What is the result of the > operator when one of the operands is a string, as in the subject line here?

Also, would it be incorrect to enclose SOURCE_SIZE in %% in this case?  i.e. PATCH_IF (%SOURCE_SIZE% > 0x71)

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1060
Re: PATCH_IF (SOURCE_SIZE > ~0x71~) ?
« Reply #1 on: February 09, 2016, 12:48:40 PM »
When a string is used where an integer is expected, WeiDU evaluates it as a variable (unless it can be int_from_stringed, like the one in the title). Things like %SOURCE_SIZE% is and always (aside from possibly early versions of WeiDU) has been semantically equivalent to "SOURCE_SIZE" and has nothing to do with how anything works, just the fact that WeiDU's old LALR parser required you to use string delimiters.
« Last Edit: February 09, 2016, 12:50:44 PM by Wisp »

Offline agb1

  • Planewalker
  • *****
  • Posts: 30
Re: PATCH_IF (SOURCE_SIZE > ~0x71~) ?
« Reply #2 on: February 09, 2016, 01:03:49 PM »
Thanks.  So the expression in the subject line is valid and will work as intended (only patch files exceeding 0x71 bytes)?

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1060
Re: PATCH_IF (SOURCE_SIZE > ~0x71~) ?
« Reply #3 on: February 09, 2016, 01:12:00 PM »
Yes.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: