Is there anyway to check like
If("22"==integer)
if("<22,22,22>"==vector)
thanks.
These forums are CLOSED. Please visit the new forums HERE
Is String a valid type? |
|
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
|
12-12-2009 00:02
Is there anyway to check like
If("22"==integer) if("<22,22,22>"==vector) thanks. |
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
12-12-2009 00:14
copied from http://lslwiki.net/lslwiki/wakka.php?wakka=vector
CODE // Returns TRUE if the string is a vector _____________________
Dark Heart Emporium
http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020 want more layers for tattoos, specifically for the head? vote here http://jira.secondlife.com/browse/VWR-1449? llDetectedCollision* Functions similar to touch http://jira.secondlife.com/browse/SVC-3369 |
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
12-12-2009 03:46
Here is something a lot more simplistic.
CODE
It does have problems with zero vectors, and integers where there are leading zeros. _____________________
|
Void Singer
Int vSelf = Sing(void);
![]() Join date: 24 Sep 2005
Posts: 6,973
|
12-12-2009 06:22
or the trully simplistic
if ((vector)vStrTest) //-- actually the same as pale's test above only shorter, neither will accept ZERO_VECTOR as valid though if ((string)((integer)vStrTest) == vStrTest) can be simplified to if ((integer)vStrTest) but will suffer from converting some invalid strings into valid integers ("12s" becomes 12) and both versions can over/underflow on large integers. (causing either fals negatives, or false positives. _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |