Sub Click(Source As Button)
Dim Wert1 As Integer
Dim Wert2 As Integer
Wert1 = 5
Wert2 = 7
Messagebox "Unsauber: " & Wert1 + Wert2
Messagebox "Auch nicht sauber, aber erwartetes Ergebnis: " & Wert1 & Wert2
Messagebox "Sauber: " & Cstr (Wert1) & Cstr (Wert2)
End Sub
Wenn man mit Cstr(i) arbeitet, ist es egal, ob + oder &. Dann aber bitte & ;D
(aus meinen subjektiv ästhetischem Empfinden)
Messagebox "Auch nicht sauber, aber erwartetes Ergebnis: " & Wert1 & Wert2
Zwischen was Notes implizit macht und was sinnvoll ist besteht meiner Meinung nach noch ein Unterschied. Und implizite Typumwandlung ist - was die Wartbarkeit und Fehlersuche betrifft - schwierig nachzuvollziehen.
Gerade bei Messagebox mache ich da aber eine Ausnahme, ich musste auch noch nie Fehler in einer Messagebox suchen (außer Leerzeichen und/oder Zeilenumbruch zuviel/zuwenig).
Gerade bei Messagebox mache ich da aber eine Ausnahme, ich musste auch noch nie Fehler in einer Messagebox suchen (außer Leerzeichen und/oder Zeilenumbruch zuviel/zuwenig).
Entweder - oder, Matthias ...
PS: Ich habe jetzt sogar den Teamstudio Configurator über alle wesentlichen Apps gejagt, damit er "msgbox" gegen "Messagebox" austauscht (und habe mir angewöhnt, nur noch diese Notation zu verwenden), damit ich irgendwann mal nach zwei möglichen Notationen suchen muss. Aus Erfahrung ...Ups, hoffentlich bekommst Du nie Code von mir zum Suchen ;D
"Oral history" is that when LotusScript was being created...
The Lotus dev weenies went to the lawyers-on-high and asked, "OK, we basically want to rip off Microsoft's VB, make it better, and stick it in all our products. What do we need to do to keep from getting our asses sued by Darth Bill and the M$ Legal Deathstar?"
The Lotus lawyers went and meditated... "oooouuuuuhhhhhhmmmmm....." "AAAAAAAammmmmiiiiiPPPPrrrrrrroooooooo....."
They came back in an indeterminable time later and said, "In order for the Manzi Federation to keep the M$ Legal Deathstar at bay you must change these six things [ed. note: I heard it was 6, may be 5, don't know] these 6 things are (a drumroll was heard off in the distance, completely unlike an Alex van Halen drum solo):
use MessageBox instead of MsgBox
use Option Declare instead of Option Explicit
use Forall instead of For Each
[ed. note: the rest is lost from my version of the oral history. sorry. at this point imagine hearing the "Girl from Ipanema" as a musical interlude instead]
So, that's the way I heard it. Your mileage may vary. I'm sure others can add their recounting of this favorite fireside story to the discussion.
Update: In a flash of lucidity I remembered to check the Help file - here's a list of aliases in LotusScript...
Bernhard: Ampersand UND CStr ist für mich eindeutig nicht sauber. Warum? Ampersand ruft den CStr intern auf, fügt man ihn dazu, wird er zweimal ausgeführt. Wozu?
It was 4 things, not 6
Otherwise, you got it right. The follow up was that during the deliberations, Lotus got bought by IBM. The product manager went to some IBM lawyers and presented the same question. The IBM lawyers essentially said, "Take whatever keywords you want. Let 'em sue us."
Thus is the mighty power of IBM
This appendix lists the LotusScript aliases and their equivalent text.
An alias is an alternate spelling of a language keyword (usually VB compliant) such as "MsgBox" for the LotusScript "MessageBox" function.
LotusScript Syntax Alias
ActivateApp AppActivate
CDat CVDate
DataType VarType
DateNumber DateSerial
GetFileAttr GetAttr
Implode Join
MessageBox MsgBox
NoCase (Option Compare) Text (Option Compare)
Option Declare Option Explicit
SetFileAttr SetAttr
StrCompare StrComp
TimeNumber TimeSerial
Yield DoEvents