Welcome, Guest. Please login or register.
Did you miss your activation email?
November 26, 2014, 01:18:37 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Mach Screens
| | |-+  Flash Screens
| | | |-+  Function to get a number from a string!?
Pages: 1   Go Down
Print
Author Topic: Function to get a number from a string!?  (Read 4109 times)
0 Members and 1 Guest are viewing this topic.
azambuja
Active Member

Offline Offline

Posts: 10


View Profile
« on: October 15, 2008, 10:06:08 AM »

Hello friends!!!

I need to count the numbers of letters of a _root.something (exemple: String="something" to get Number=9, or something like that) and with this number I can use it in a If condition.

Thanks for your supply.

Azambuja
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 4,066



View Profile WWW
« Reply #1 on: October 15, 2008, 10:31:29 AM »

Try:

mystring = "something"
X = LEN(mystring)

X should be 9.

You might be able to just do:

X = LEN("something")
Logged

azambuja
Active Member

Offline Offline

Posts: 10


View Profile
« Reply #2 on: October 15, 2008, 10:58:26 AM »

Hey man!!
Thanks but it does not work. Maybe I am not using it in the right way.

Azambuja
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 4,066



View Profile WWW
« Reply #3 on: October 15, 2008, 12:43:08 PM »

Is it case sensitive? Try Len and not LEN? That's the VBA function. Maybe the script function is different. I'll have to check the docs.
Logged

zealous
Active Member

Offline Offline

Posts: 489


HI!


View Profile WWW
« Reply #4 on: October 16, 2008, 02:29:39 AM »

I think he meant in Flash and not VB   

This will return the number of your strings length:

Code:
MyString.length


this will check to see if the digits are 9:

Code:
if (MyString.length == 9) {
trace("Is 9");
} else {
trace("Is not 9 it is:"+ MyString.length);
}

.....but you can take the code they gave for VB  and run it in flash but you have to do it like this and I dont belive you can split and join in Mach's VB

fscommand("VBMacro" "some VB here")
« Last Edit: October 17, 2008, 03:29:04 AM by zealous » Logged

ger21
Global Moderator
*
Offline Offline

Posts: 4,066



View Profile WWW
« Reply #5 on: October 16, 2008, 08:09:10 AM »

Oops, didn't see that it was in the Flash section. Smiley

Thanks Jason
Logged

zealous
Active Member

Offline Offline

Posts: 489


HI!


View Profile WWW
« Reply #6 on: October 17, 2008, 03:27:02 AM »

NP  Smiley
Logged

azambuja
Active Member

Offline Offline

Posts: 10


View Profile
« Reply #7 on: October 17, 2008, 06:43:37 AM »

Thanks Zealous!!

That worked. Now I can continue to work.

Azambuja
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!