Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TYPE and CONST within SUB/FUNCTION
#7
Example of connecting two string constants in the main program and a function (procedure works the same way).

Code: (Select All)
'Beispiel fuer Nutzung einer Konstanten in einer Funktion(Prozedur) - 10. Juli 2023

Option _Explicit

Declare Function satzErgaenzen(satz As String) as String

Const Stanislaw = "His conscience was clear, "

Locate 2, 3
Print "Konstanten verbinden in Hauptprogramm und Funktion"
Locate 3, 3
Print "=================================================="

Locate 5, 3
Print satzErgaenzen(Stanislaw)

End

Function satzErgaenzen$ (Stanislaw As String)

  Const Ergaenzen = "he never used it! -- Stanislaw Jerzy Lec"

  Stanislaw = Stanislaw + Ergaenzen
  satzErgaenzen = Stanislaw
End Function
Reply


Messages In This Thread
RE: TYPE and CONST within SUB/FUNCTION - by bplus - 07-10-2023, 12:30 AM
RE: TYPE and CONST within SUB/FUNCTION - by bplus - 07-10-2023, 12:55 AM
RE: TYPE and CONST within SUB/FUNCTION - by Kernelpanic - 07-10-2023, 04:47 PM
RE: TYPE and CONST within SUB/FUNCTION - by bplus - 07-11-2023, 01:22 AM



Users browsing this thread: 2 Guest(s)