Pflichtfeld Active Member Licensed User Jul 13, 2020 #1 Might be a bit hard to read: gv is a class with global variables, MpSprache is a map with language-strings. The text of a label assumes values, dependend of choosen tab-page (mLastTabPage): B4X: lbl0.Text=Array As String(gv.MpSprache.Get("fase"),gv.MpSprache.Get("steindurchmesser"),"",gv.MpSprache.Get("steindurchmesser"),gv.MpSprache.Get("jiglen"))(mLastTabPage) In this above line, I get a compiling-error: I know, I could solve this by changing the way assigning the .text-value, but I would be interested in the reason of this compiling error. Thank you in advance! TH
Might be a bit hard to read: gv is a class with global variables, MpSprache is a map with language-strings. The text of a label assumes values, dependend of choosen tab-page (mLastTabPage): B4X: lbl0.Text=Array As String(gv.MpSprache.Get("fase"),gv.MpSprache.Get("steindurchmesser"),"",gv.MpSprache.Get("steindurchmesser"),gv.MpSprache.Get("jiglen"))(mLastTabPage) In this above line, I get a compiling-error: I know, I could solve this by changing the way assigning the .text-value, but I would be interested in the reason of this compiling error. Thank you in advance! TH
Erel B4X founder Staff member Licensed User Longtime User Jul 13, 2020 #2 Please post it as text instead of screenshot. Upvote 0
Pflichtfeld Active Member Licensed User Jul 13, 2020 #3 Erel said: Please post it as text instead of screenshot. Click to expand... Sorry, didn't know, that c&p works here: B4A Version: 9.80 Java Version: 11 Parsing code. (0.36s) Building folders structure. (0.17s) Compiling code. (1.07s) Compiling layouts code. (0.05s) Organizing libraries. (0.00s) (AndroidX SDK) Generating R file. (8.06s) Compiling debugger engine code. Error B4A line: 217 lbl0.Text=Array As String(gv.MpSprache.Get(\ shell\src\b4a\SharpenItDebug\getangle_subs_0.java:856: error: ')' expected getangle.mostCurrent._lbl0.runMethod(true,"setText",BA.ObjectToCharSequence(RemoteObject.createNewArray("String",new int[] {5},new Object[] {BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("fase"))))),BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("steindurchmesser"))))),BA.ObjectToString(""),BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("steindurchmesser"))))),BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("jiglen")))))})(getangle._mlasttabpage))); ^ 1 error Upvote 0
Erel said: Please post it as text instead of screenshot. Click to expand... Sorry, didn't know, that c&p works here: B4A Version: 9.80 Java Version: 11 Parsing code. (0.36s) Building folders structure. (0.17s) Compiling code. (1.07s) Compiling layouts code. (0.05s) Organizing libraries. (0.00s) (AndroidX SDK) Generating R file. (8.06s) Compiling debugger engine code. Error B4A line: 217 lbl0.Text=Array As String(gv.MpSprache.Get(\ shell\src\b4a\SharpenItDebug\getangle_subs_0.java:856: error: ')' expected getangle.mostCurrent._lbl0.runMethod(true,"setText",BA.ObjectToCharSequence(RemoteObject.createNewArray("String",new int[] {5},new Object[] {BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("fase"))))),BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("steindurchmesser"))))),BA.ObjectToString(""),BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("steindurchmesser"))))),BA.ObjectToString(getangle.mostCurrent._gv.getField(false,"_mpsprache" /*RemoteObject*/ ).runMethod(false,"Get",(Object)((RemoteObject.createImmutable("jiglen")))))})(getangle._mlasttabpage))); ^ 1 error
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2020 #4 It is a parser limitation. This will also won't work: Code: Dim a As String = Array("Sdfsdf")(0) You will need to write it like this: Code: Dim arr() As Object = Array("Sdfsdf") Dim a As String = arr(0) Upvote 0
It is a parser limitation. This will also won't work: Code: Dim a As String = Array("Sdfsdf")(0) You will need to write it like this: Code: Dim arr() As Object = Array("Sdfsdf") Dim a As String = arr(0)