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.

How GetArray PutArray works?

Featured Replies

  • Author
  • Localization

n97t7f7b57f, posted Sun May 10, 2015 11:10 am (5182)


How can i get variable value from array?
Code:
PutArray 0 Ncount 0
goto NToffset
// get name of File in Name Table
for i = 0 < Ncount
get Nsize long
getdstring Name Nsize
putarray 0 -1 Name
next i

GetArray cell 0 5
print "%cell%"

SCRIPT's MESSAGE: cell
but 5th array element is "Texture2D"
  • Author
  • Localization

aluigi, posted Sun May 10, 2015 4:09 pm (5189)


The script seems correct, I don't see issues except a possible problem caused by the first instruction that may make "putarray 0 -1 Name" to work from Ncount instead of 0.

Then do you know that the first index of an array is 0 and not 1?
"GetArray cell 0 5" takes the 6th element, just like 'i'.
  • Author
  • Localization

n97t7f7b57f, posted Sun May 10, 2015 5:13 pm (5192)


aluigi wrote:
Then do you know that the first index of an array is 0 and not 1?
"GetArray cell 0 5" takes the 6th element, just like 'i'.

i'm ok with that

aluigi wrote:
The script seems correct, I don't see issues except a possible problem caused by the first instruction that may make "putarray 0 -1 Name" to work from Ncount instead of 0.

You are right. I removed "PutArray 0 Ncount 0" and it works.
Thank you.

But how i should initialize an array?
Ncount is number of strings in Name table
aluigi wrote:
It's highly suggested to pre-allocate the array if you know the max value, example: PutArray 0 FILES 0
  • Author
  • Localization

aluigi, posted Sun May 10, 2015 5:22 pm (5194)


You can initialize it like you did but then you must specify the correct index with putarray and not -1 which appends the element at the end.
So you must use "putarray 0 i Name", just that.
  • Author
  • Localization

n97t7f7b57f, posted Sun May 10, 2015 5:29 pm (5195)


aluigi wrote:
You can initialize it like you did but then you must specify the correct index with putarray and not -1 which appends the element at the end.
So you must use "putarray 0 i Name", just that.

Got it. Thank you again
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.