Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing string variable value within Sub
#6
This made me want to see what happens when the wrong data type is passed. Nothing happens. Shouldn't there be an error message?

Code: (Select All)

'Beispiel fuer falsche Uebergabe an Prozedur/Funktion - 24. Feb. 2025

Option _Explicit

Declare Function Beispiel(kilowatt As Double) As Double

Dim As Double eingabe
Dim As Integer eingabe1

Print
Print "Kilowatt in PS"
Print: Print

Input "Kilowatt eingeben: ", eingabe1
Print
Print Using "Das sind ###.## PS"; Beispiel(eingabe1)


Function Beispiel (kilowatt As Double)

  Dim As Double ps

  ps = kilowatt * 1.36
  Beispiel = ps

End Function

[Image: Falscher-Datentyp2025-02-25.jpg]
Reply


Messages In This Thread
RE: Changing string variable value within Sub - by Kernelpanic - 02-25-2025, 03:39 PM



Users browsing this thread: 18 Guest(s)