English
Functions and Help

§ 9 - variables

 
variables go automatically declared. you're pub and typen-dynamic.

The Wertetyp of/ one variables corresponds to always the values-Type the last Zuweisung.
i=1// now i type long
i="Hallo"//  now i type string
i=1.1//  now i type float

it can also in a Slip complex Structures definiert go:
myvar=[
"woods1"=[
"apples"=20
"pears"=30
]
"town"=[
"autos"=20
"moves"=[

]
]

the same with OOP-spelling:

Opportunities with numerischen Schlüsseln:
a=[10,20,30]
a.3=40
print a.0

however:
b=5
print a.b//corresponds to not a.5 separate a["b"]
//
print a[b]//corresponds to a[5]

Stringkonstanten can with " as well as - what right useful is - with ' umschlossen definiert go.
s="Hallo"
s='Hello'

for Arrays simply in eckiger Klammer kommagetrennte values: [10,20,30,...]  
a=[10,20,30]

becomes on a Stringvariable like a aray zugegriffen by eckicke clinging so can on each single characters zurückgegriffen go as would the String one CharArray:
a="test"
print a[2]//gives s from
//too possibly:
print "test"[2]// gives s from

Info: Assoziative Arrays with OOP-spelling benefit:
a.groove.beat=10
// corresponds to
a["groove"]["beat"]=10

Datentyp of/ one variables detect:
a=5
case °a == "long" :

Related: § 5 - Datentypen
 
12/02/14  
 




Michael
W.
get String then Untertypen?
Ansistring, Widestring16, Utf-8

such a thing ähnliches runs Yes with FreePascal...
whom Stringtyp uses Android because at all.
 
XProfan X3
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
12/02/14  
 



i'll everything possible to UTF8 report.

Android nativ uses imho too "nur" ansi, The Apps against can sonstwelche Zeichensätze use.
 
12/02/14  
 



Stringkonstanten spelling


Nachtrag: Stringkonstanten cannot only with "And ' umschlossen
definiert go separate too by acutely ´ (  [...]  ) .

the has so many advantages.

in example can The string(n)

Max's Burger -> "Max's Burger",
Max "Jonas" Mustermann -> 'Max "Jonas" Mustermann',
Max's Burger "Jonas" Mustermann -> ´Max's Burger "Jonas" Mustermann´

define.
 
12/03/14  
 



Arrays spelling


Nachtrag: have long hither and thither consider (haha, grüble quasi already since years dran), which The simplest but of my opinion to too sinnvollste Arrayschreibweise his could z.B. even if one Arrays as Parameter transfer would like but without a variable To deklarieren.

or plainer: How should one var looks for a aray the same values get. now have I a imho very tidy Solution:

on the example the function Input can it well explain.

momentarily Parameter: cover, default, ButtonsBeschriftungenAlsArray.

And so GEHTS:
CompileMarkSeparation
input "Titel","VorgabeText",["Button1-Text","Button2-Text",...]
//oder
var meinArray=[10,20,30]re>

I find' the "perfekt". simply only The eckigen clinging without Bingbong and Klimperdideldu.

@Roland: Perhaps. can You too for XProfan X3 these spelling translate? I stops the simply for best. the Schlüsselwort aray is so superfluously.
 
12/04/14  
 



Nachtrag:

2 new Types: zero and Bool

are hinzugekommen To: Long, Float, String, Array and Proc

where the type zero too always the value zero has, not 0!

in example can The date- and Zeitfunktionen zero back supplying z.B. with ungültigen Operationen but too 0 as valid worth.
 
12/27/14  
 



The individual values of Arrays can unterschiedlichen Type his:

var a=[10,20,"Hallo",10.5,["Test",50,zero,60,[true,false,msgbox],true,100],false,200]
 
01/11/15  
 



Stringspecial: becomes on a Stringvariable like a aray zugegriffen by eckicke clinging so can on each single characters zurückgegriffen go as would the String one CharArray:

var a="test"
print a[2] //gives s from

too possibly:

print "test"[2] // gives s from
 
01/11/15  
 



an Variable must not very so hot as an Proc or one of Functions bereitgestelltes Schlüsselwort.
 
05/24/15  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.861 Views

Untitledvor 0 min.
Erasmus.Herold04/01/16
Nico Madysa03/28/16
iF03/08/16
Micha1233403/02/16
More...

Themeninformationen

this Topic has 2 subscriber:

iF (8x)
Michael W. (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie