Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

VBScript / How to use standard VB syntax

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
User avatar
florian
Posts: 58
Joined: 18 Feb 2012, 19:42

VBScript / How to use standard VB syntax

Post by florian » 21 Feb 2012, 22:16

Hi

I'm looking for using standard VB syntax like Trim or Chr.
How to activate them under the script editor ?
I get Compilation error each time I use these functions

Code: Select all

		outChapitreBool = False
		If Trim(B_chapitre) <> "" Then
			outChapitre = Trim(B_chapitre)
			outChapitreBool = True
			
			changed = True
		End If
			
		outSessionBool = False
		If Trim(C_titre) <> "" Then
			outSession = Trim(C_titre)
			outSessionBool = True

			changed = True
		End If				
		
		' outIntervenants = 
		outDebug = A_heure & ". " & B_chapitre & chr(13) & chr(10)&  C_titre
Florian

User avatar
Daniel Willer
Posts: 309
Joined: 06 Jan 2012, 18:12

Re: VBScript / How to use standard VB syntax

Post by Daniel Willer » 22 Feb 2012, 11:54

There are syntax errors in your code have a look here.

User avatar
florian
Posts: 58
Joined: 18 Feb 2012, 19:42

Re: VBScript / How to use standard VB syntax

Post by florian » 22 Feb 2012, 12:02

Oups, right !
I used to code in Perl so i still have my old reflex...

Do you have any web link with condensed references about basic VB scripting?
Thanks,
Florian

User avatar
florian
Posts: 58
Joined: 18 Feb 2012, 19:42

Re: VBScript / How to use standard VB syntax

Post by florian » 26 Feb 2012, 02:39

Hi,

I tried several way to code and i still have some incompatibilities like this one :

(VBscript)

Code: Select all

		'	json   =     {"id":123264,"username":"cobalt","user_id":1,"quote":"Azerazerzaerzaera","url_avatar":"","posted_at":1330018915,"votes":0,"time":1330018915,"type":0,"posted_via":0,"moderation":1,"favori":0},
		debug = ""
		
		Dim regex As String = "quote"":"""  
		Dim tableau() As String = json.Split(regex)
		
		For i As Integer = 0 To tableau.Length - 1
			debug = debug & tableau(i) & "__"
		Next		
my regex variable would be interpret as a Char ("q") and not as a string ("quote...")
The tooltip when i type a Split( indicates 6 ways to use sur function (3 with Char delimiter, 3 with String Delimiter) but no way to use the String delimiter

String Splitter node use only Char delimiter

I discover several way to code on MSDN
http://msdn.microsoft.com/fr-fr/library ... split.aspx
http://msdn.microsoft.com/en-us/library/tabh47cf.aspx

Code: Select all

Dim phrase As String = "The quick brown fox"
Dim words() As String

words = phrase.Split(TryCast(Nothing, String()),  
                       StringSplitOptions.RemoveEmptyEntries)

words = phrase.Split(New String() {},
                     StringSplitOptions.RemoveEmptyEntries)

With 2 ways to do it, and different arguments
which one should i use ?

Thanks for your help,
Florian

User avatar
florian
Posts: 58
Joined: 18 Feb 2012, 19:42

Re: VBScript / How to use standard VB syntax

Post by florian » 04 Mar 2012, 19:06

up
Florian

Post Reply