F FrankDev Active Member Licensed User Longtime User Jan 19, 2022 #1 hello Question about the designer. is it somehow possible to use variables ? I need to know a calculated value again and again. Greetings Frank
hello Question about the designer. is it somehow possible to use variables ? I need to know a calculated value again and again. Greetings Frank
William Lancee Well-Known Member Licensed User Longtime User Jan 19, 2022 #3 More information needed. What property do want to modify? What do want to make a variable? Upvote 0
klaus Expert Licensed User Longtime User Jan 19, 2022 #4 Yes you can. Example: Calculate the width of three Buttons covering the full screen width with a given space. B4X: Space = 10dip Width = (100%x - 4 * Space) / 3 Button1.Left = Space Button1.Width = Width Button2.Left = Button1.Right + Space Button2.Width = Width Button3.Left = Button2.Right + Space Button3.Width = Width Upvote 1
Yes you can. Example: Calculate the width of three Buttons covering the full screen width with a given space. B4X: Space = 10dip Width = (100%x - 4 * Space) / 3 Button1.Left = Space Button1.Width = Width Button2.Left = Button1.Right + Space Button2.Width = Width Button3.Left = Button2.Right + Space Button3.Width = Width
F FrankDev Active Member Licensed User Longtime User Jan 19, 2022 #5 Hello Klaus, this is exactly what I was looking for. My problem was, I had tried to dim the variable. that did not work. On the idea not to dimension the variable I did not come Thanks !!!!! Best regards Frank Upvote 0
Hello Klaus, this is exactly what I was looking for. My problem was, I had tried to dim the variable. that did not work. On the idea not to dimension the variable I did not come Thanks !!!!! Best regards Frank
AnandGupta Expert Licensed User Longtime User Jan 20, 2022 #6 klaus said: Yes you can. Example: Calculate the width of three Buttons covering the full screen width with a given space. B4X: Space = 10dip Width = (100%x - 4 * Space) / 3 Button1.Left = Space Button1.Width = Width Button2.Left = Button1.Right + Space Button2.Width = Width Button3.Left = Button2.Right + Space Button3.Width = Width Click to expand... I also did not knew it. Thanks. Upvote 0
klaus said: Yes you can. Example: Calculate the width of three Buttons covering the full screen width with a given space. B4X: Space = 10dip Width = (100%x - 4 * Space) / 3 Button1.Left = Space Button1.Width = Width Button2.Left = Button1.Right + Space Button2.Width = Width Button3.Left = Button2.Right + Space Button3.Width = Width Click to expand... I also did not knew it. Thanks.
F FrankDev Active Member Licensed User Longtime User Jan 20, 2022 #7 Hello @klaus , but it does not work with any variable name ? I had used 'breite'. That did not work. Regards Frank Upvote 0
Hello @klaus , but it does not work with any variable name ? I had used 'breite'. That did not work. Regards Frank
LucaMs Expert Licensed User Longtime User Jan 20, 2022 #8 FrankDev said: Hello @klaus , but it does not work with any variable name ? I had used 'breite'. That did not work. Regards Frank Click to expand... Without apostrophes, I hope. Upvote 0
FrankDev said: Hello @klaus , but it does not work with any variable name ? I had used 'breite'. That did not work. Regards Frank Click to expand... Without apostrophes, I hope.
F FrankDev Active Member Licensed User Longtime User Jan 20, 2022 #9 @LucaMs >Without apostrophes, I hope.< with ' does not go ???? Upvote 0
klaus Expert Licensed User Longtime User Jan 20, 2022 #10 FrankDev said: I had used 'breite'. Click to expand... What does not work? The code below works! B4X: Spalte = 10dip Breite = (100%x - 4 * Spalte) / 3 Button1.Left = Spalte Button1.Width = Breite Button2.Left = Button1.Right + Spalte Button2.Width = Breite Button3.Left = Button2.Right + Spalte Button3.Width = Breite Upvote 0
FrankDev said: I had used 'breite'. Click to expand... What does not work? The code below works! B4X: Spalte = 10dip Breite = (100%x - 4 * Spalte) / 3 Button1.Left = Spalte Button1.Width = Breite Button2.Left = Button1.Right + Spalte Button2.Width = Breite Button3.Left = Button2.Right + Spalte Button3.Width = Breite
F FrankDev Active Member Licensed User Longtime User Jan 20, 2022 #11 @klaus Breite = (((panNumbers.Width - 22dip) - (panNumber1.width * 5)) / 4) + panNumber1.width ->>Die Datei ObfuscatorMap.txt wurde im Objects-Verzeichnis angelegt. Kompiliere Layoutcode. Error Unassigned variable: 'width' Width = (((panNumbers.Width - 22dip) - (panNumber1.width * 5)) / 4) + panNumber1.width works Upvote 0
@klaus Breite = (((panNumbers.Width - 22dip) - (panNumber1.width * 5)) / 4) + panNumber1.width ->>Die Datei ObfuscatorMap.txt wurde im Objects-Verzeichnis angelegt. Kompiliere Layoutcode. Error Unassigned variable: 'width' Width = (((panNumbers.Width - 22dip) - (panNumber1.width * 5)) / 4) + panNumber1.width works
klaus Expert Licensed User Longtime User Jan 20, 2022 #12 You need to show the entire code in the Designer. It seems that you have still somewhere a variable width. Upvote 0
You need to show the entire code in the Designer. It seems that you have still somewhere a variable width.
F FrankDev Active Member Licensed User Longtime User Jan 20, 2022 #13 only this code I had also tried other variable names - without sucess B4X: 'All variants script AutoScaleAll Trenner1.Width = 2dip width = (((panNumbers.Width - 22dip) - (panNumber1.width * 5)) / 4) + panNumber1.width panNumber2.Left = panNumber1.Left + Width panNumber3.Left = panNumber2.Left + Width panNumber4.Left = panNumber3.Left + Width panNumber5.Left = panNumber4.Left + Width panNumber7.Left = panNumber6.Left + Width panNumber8.Left = panNumber7.Left + Width panNumber9.Left = panNumber8.Left + Width panNumber0.Left = panNumber9.Left + Width Upvote 0
only this code I had also tried other variable names - without sucess B4X: 'All variants script AutoScaleAll Trenner1.Width = 2dip width = (((panNumbers.Width - 22dip) - (panNumber1.width * 5)) / 4) + panNumber1.width panNumber2.Left = panNumber1.Left + Width panNumber3.Left = panNumber2.Left + Width panNumber4.Left = panNumber3.Left + Width panNumber5.Left = panNumber4.Left + Width panNumber7.Left = panNumber6.Left + Width panNumber8.Left = panNumber7.Left + Width panNumber9.Left = panNumber8.Left + Width panNumber0.Left = panNumber9.Left + Width
R RichardN Well-Known Member Licensed User Longtime User Jan 20, 2022 #15 I believe 'Width' is a reserved word. Try another variable name. Violations of reserved words can be very difficult to debug..... as the error you get does not always give a clue to the error the compiler has experienced Upvote 0
I believe 'Width' is a reserved word. Try another variable name. Violations of reserved words can be very difficult to debug..... as the error you get does not always give a clue to the error the compiler has experienced
LucaMs Expert Licensed User Longtime User Jan 20, 2022 #16 RichardN said: I believe 'Width' is a reserved word. Try another variable name. Click to expand... The suspicion was legitimate but no, I tried (B4J) and it isn't. Upvote 0
RichardN said: I believe 'Width' is a reserved word. Try another variable name. Click to expand... The suspicion was legitimate but no, I tried (B4J) and it isn't.
F FrankDev Active Member Licensed User Longtime User Jan 20, 2022 #17 'Klaus' example works with width Upvote 0