07-25-2022, 02:50 PM
I could be having a brain misfire, but I could swear the $replace function worked in QB64, why am I getting an illegal string-number conversion on line 9?
Code: (Select All)
Dim sOld$
Dim sOldWord$
Dim sNewWord$
Dim sNew$
sOld$ = "This is my sentence to change my words."
sOldWord$ = "my"
sNewWord$ = "your"
sNew$ = Replace$(sOld$, sOldWord$, sNewWord$)
Print "Original: " + Chr$(34) + sOld$ + Chr$(34)
Print "Replace : " + Chr$(34) + sOldWord$ + Chr$(34)
Print "With : " + Chr$(34) + sNewWord$ + Chr$(34)
Print "New : " + Chr$(34) + sNew$ + Chr$(34)