Calc(a as double, ByRef x as double, ByRef y as double,ByRef z as double) as double
Is it possible to convert this above function for string returning values like:
Calc( a as double) as string
x=a *10
y=a *100
z= a * 1000
return x + “|” + y + “|” + z
Public Function LBR_For(Object_Name, At_JDE)
' LBR_For_Terre_or_Soleil()
' LBR_For_Mercure()
' LBR_For_Venus()
' LBR_For_Mars()
' LBR_For_Jupiter()
' LBR_For_Saturne()
' LBR_For_Uranus()
' LBR_For_Neptune()
Dim LBR As String
LBR = "ERROR"
Dim Object As String
Object = UCase(Trim(Object_Name))
If Object = "SOLEIL" Then LBR = LBR_For_Terre_or_Soleil(At_JDE, "S")
If Object = "EARTH" Then LBR = LBR_For_Terre_or_Soleil(At_JDE, "T")
If Object = "LUNE" Then LBR = LBR_For_Lune(At_JDE)
If Object = "MERCURE" Then LBR = LBR_For_Mercure(At_JDE)
If Object = "VENUS" Then LBR = LBR_For_Venus(At_JDE)
If Object = "MARS" Then LBR = LBR_For_Mars(At_JDE)
If Object = "JUPITER" Then LBR = LBR_For_Jupiter(At_JDE)
If Object = "SATURNE" Then LBR = LBR_For_Saturne(At_JDE)
If Object = "URANUS" Then LBR = LBR_For_Uranus(At_JDE)
If Object = "NEPTUNE" Then LBR = LBR_For_Neptune(At_JDE)
If LBR = "ERROR" Then
LBR_For = LBR & ": """ & Object & """ = Nom inappropri !"
Beep
Exit Function
End If
LBR_For = LBR
End Function
Also, all planets returns spherical Coordinates L,B,R as string in the format : L + “|” + B + “|” + R
[quote=101599:@Djamel AIT AMRANE]Calc(a as double, ByRef x as double, ByRef y as double,ByRef z as double) as double
Is it possible to convert this above function for string returning values like:
Calc( a as double) as string
x=a *10
y=a *100
z= a * 1000
return x + “|” + y + “|” + z[/quote]
You can’t simply concatenate numbers and strings like that. You have to convert the numbers to strings with str, e.g., str(x) + “|” + str(y) etc
[quote]
Syed Hassan
4 hours ago Beta Testers, Xojo Pro
//
// For ‘Calc( a as double) as string’, the following should work.
//
Return Trim( Str( L)) + “|” + Trim( Str( B)) + “|” + Trim( Str( R))[/quote]
i get Message Syntax Error, my function in written like this under VB6:
LBR_For(Object_Name , At_JDE as double) as string Function LBR_For_Venus(At_JDE as double)
…
…
’ Return LBR values within a delimited string.
LBR_For_Venus = L & “|” & B & “|” & R End function
Under Xojo it looks like this: LBR_For_Venus(At_JDE as double) as string
…
… return L + “|” + B + “|” + R
[quote=101778:@Djamel AIT AMRANE]i get Message Syntax Error,
…
…
…
Under Xojo it looks like this: LBR_For_Venus(At_JDE as double) as string
…
… return L + “|” + B + “|” + R[/quote]
The message ‘Syntax Error’ requires qualification. What is the line of code showing this error please?
//
// Function ReturnString() As String
//
// This compiles and executes without any error.
//
Dim L, B, R As Double
L = 1.23
B = 2.34
R = 3.45
Dim strReturn As String
strReturn = Trim( Str( L)) + "|" + Trim( Str( B)) + "|" + Trim( Str( R))
Return strReturn