Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Solution for "greater than this and less than this" ?

Featured Replies

  • Author
  • Localization

Acewell, posted Tue Mar 14, 2017 7:56 am (21452)


Hi i am trying to read an integer and maintain a multiple of 4,
i need something like this but is invalid syntax in Quickbms
Code:
get var long
if var     var = 4
elif var > 4 and     var = 8
elif var > 8 and     var = 12
endif


Code:
elif var greater than this and less than this
    var equals this

so is there another way to put that so it works in a bms script?
thanks for any help! :)


edit
nevermind i found another way :D
Code:
get var long
xmath check "var % 4"
if check == 3
    math var 1
elif check == 2
    math var 2
elif check == 1
    math var 3
endif


another shorter way :)
Code:
get var long
xmath check "var % 4"
if check != 0
    xmath var "var - check 4"
endif


and even yet shorter way :)
Code:
get var long
math var x 4
  • Author
  • Localization

aluigi, posted Tue Mar 14, 2017 9:39 am (21454)


Your original solution was ok except that you forgot to repeat "var" in the second check:
elif var > 4 and var < 8
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.