How to use str(name) ?

Description: Internal scripting system of SMBX-38A Engine based on the simple VB-like language
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

Erwill M
Topic author, Count
Count
Avatar
Erwill M
Topic author, Count
Count
Age: 24
Reputation: 189
Posts: 295
Joined: 29 Nov 2015

Post #1by Erwill » 27 Jun 2016, 0:18

Hello.

With somes scripts that I made, I'm interested by the strings in SMBX.

But, I don't know how to use it.

To example, Tetris use str(name), but me when I write str("Name")="1" to example, there is an error.

rotom407 M
Nice citizen
Nice citizen
rotom407 M
Nice citizen
Nice citizen
Age: 25
Reputation: 0
Posts: 15
Joined: 28 Jun 2016

Post #2by rotom407 » 30 Jun 2016, 4:36

When you click the "add" button in the "variables" window, two variables are actually created: a numeric variable and a string variable.
The two variables share the same name. To use the numeric variable named "D", v(D) and val(D) are both OK. To represent the string variable named "D", you should use str(D) (not str("D")).
The following code will show a message "string2".

Code: Select all

v(D)=2
str(D)="string"
Call showMsg(str(D) & Cstr(v(D)))

Also, the method displaying the numbers and blocks are outdated in the tetris level. We can now use txtCreate to print text and even draw pictures.

Erwill M
Topic author, Count
Count
Avatar
Erwill M
Topic author, Count
Count
Age: 24
Reputation: 189
Posts: 295
Joined: 29 Nov 2015

Post #3by Erwill » 1 Jul 2016, 16:36

Ah thank you ! :)


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest