S stevenindon Active Member Licensed User Feb 11, 2022 #1 Hello all, I am creating a Customview and currently i raise Customview event as such : B4X: #Event: UserClick(svalue1 as String,svalue2 as String) ... ... ... CallSub3(mCallBack, mEventName & "_" & "UserClick","Steven","32") '<<--- Calling of Event How can i raise an event with more data? Example : CallSub3(mCallBack, mEventName & "_" & "UserClick","Steven","32","Male","North") CallSub 3 limits only to 2 parameters. Please help....
Hello all, I am creating a Customview and currently i raise Customview event as such : B4X: #Event: UserClick(svalue1 as String,svalue2 as String) ... ... ... CallSub3(mCallBack, mEventName & "_" & "UserClick","Steven","32") '<<--- Calling of Event How can i raise an event with more data? Example : CallSub3(mCallBack, mEventName & "_" & "UserClick","Steven","32","Male","North") CallSub 3 limits only to 2 parameters. Please help....
LucaMs Expert Licensed User Longtime User Feb 11, 2022 #2 stevenindon said: How can i raise an event with more data? Example : CallSub3(mCallBack, mEventName & "_" & "UserClick","Steven","32","Male","North") CallSub 3 limits only to 2 parameters. Please help.... Click to expand... There is no way to pass more than two parameters individually. Pass a Map. Upvote 0
stevenindon said: How can i raise an event with more data? Example : CallSub3(mCallBack, mEventName & "_" & "UserClick","Steven","32","Male","North") CallSub 3 limits only to 2 parameters. Please help.... Click to expand... There is no way to pass more than two parameters individually. Pass a Map.
S stevenindon Active Member Licensed User Feb 11, 2022 #3 Thank you Lucas for your prompt reply. Noted... and will use map instead. Thanks again. Upvote 0
LucaMs Expert Licensed User Longtime User Feb 11, 2022 #4 (I'm waking up in these minutes ) Another, perhaps better, way is to pass a custom type variable. This way has the advantage that you don't have to remember the Map keys, the editor will show you every data field. Upvote 1
(I'm waking up in these minutes ) Another, perhaps better, way is to pass a custom type variable. This way has the advantage that you don't have to remember the Map keys, the editor will show you every data field.
Alexander Stolte Expert Licensed User Longtime User Feb 11, 2022 #5 LucaMs said: Another, perhaps better, way is to pass a custom type variable. This way has the advantage that you don't have to remember the Map keys, the editor will show you every data field. Click to expand... what he says ? Upvote 0
LucaMs said: Another, perhaps better, way is to pass a custom type variable. This way has the advantage that you don't have to remember the Map keys, the editor will show you every data field. Click to expand... what he says ?
Marvel Active Member Licensed User Feb 11, 2022 #6 Why haven't I ever thought of passing a type ? I've always used maps. Thanks for this info @LucaMs Upvote 0
LucaMs Expert Licensed User Longtime User Feb 11, 2022 #7 LucaMs said: (I'm waking up in these minutes ) Another, perhaps better, way is to pass a custom type variable. This way has the advantage that you don't have to remember the Map keys, the editor will show you every data field. Click to expand... It also has another advantage, compared to Maps: writing (hard-coding) string keys of a Map, as well as having to remember them (unless you create a nice module that simulates an Enum - I love Enums!) you risk typing them wrong; this cannot happen with a custom type. Upvote 0
LucaMs said: (I'm waking up in these minutes ) Another, perhaps better, way is to pass a custom type variable. This way has the advantage that you don't have to remember the Map keys, the editor will show you every data field. Click to expand... It also has another advantage, compared to Maps: writing (hard-coding) string keys of a Map, as well as having to remember them (unless you create a nice module that simulates an Enum - I love Enums!) you risk typing them wrong; this cannot happen with a custom type.