Any chance to fix this old string problem?

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

akee
Enthusiast
Enthusiast
Posts: 475
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Any chance to fix this old string problem?

Post by akee »

Code: Select all

Procedure$ JoinString_Private(first$, second$ = "")
  ProcedureReturn first$ + " " + second$
EndProcedure

ProcedureDLL$ JoinString(first$)
  ProcedureReturn JoinString_Private(first$)
EndProcedure

ProcedureDLL$ JoinString2(first$, second$)
  ProcedureReturn JoinString_Private(first$, second$)
EndProcedure

Code: Select all

Debug JoinString("A", JoinString("F", "H"))    ; Output is F H instead of A F H
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Any chance to fix this old string problem?

Post by Joris »

You used the wrong one.

Debug JoinString2("A", JoinString2("F", "H"))
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
akee
Enthusiast
Enthusiast
Posts: 475
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Re: Any chance to fix this old string problem?

Post by akee »

Joris,
This will not work because JointString2 is already compiled with TailBite so it cannot be detected. :wink:
acreis
Enthusiast
Enthusiast
Posts: 182
Joined: Fri Jun 01, 2012 12:20 am

Re: Any chance to fix this old string problem?

Post by acreis »

I don't have Tailbite here.

Should you pelase confirm the problem with the following code?

Code: Select all

Procedure$ JoinString_Private(first$, second$)
  ProcedureReturn first$ + " " + second$
EndProcedure

ProcedureDLL$ JoinString(first$)
  ProcedureReturn JoinString_Private(first$, "")
EndProcedure

ProcedureDLL$ JoinString2(first$, second$)
  ProcedureReturn JoinString_Private(first$, second$)
EndProcedure
akee
Enthusiast
Enthusiast
Posts: 475
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Re: Any chance to fix this old string problem?

Post by akee »

Tailbite the longer code with the latest then run the debug example.
Post Reply