English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 15 September 2019, 12:21   #1
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 208
[blitz] splitting strings

Hi,
is there a "pre-made" function to split a string at given delimeter or do I have to write one myself (i'm asking because there is so many additional commands that is hard to find)


For example I would like to get 4 strings from following:
s$="field1;field2;field3;field4"

Did one myself using Instr() and Left() but then I realised that Instr() doesn't recognise ";" symbol.

Thanks
peceha is offline  
Old 15 September 2019, 15:59   #2
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 208
Never mind.
There was something wrong going on when I ran the program but now the ";" sign is being recognized so everything works just fine

Thanks
peceha is offline  
Old 15 September 2019, 22:20   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,929
If the file you're trying to read is written by your own program, consider using Fields instead.
idrougge is offline  
Old 15 September 2019, 23:02   #4
peceha
Registered User

peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 43
Posts: 208
I had no idea about that command - thanks, will use it in the future.

Unfortunately present file is done by external program (mp3info) and looks like:
path;artist;title;year
path;artist;title;year
....
peceha is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Repeatable crashes with NEWTYPEs, Pointers and Strings (Blitz 2.1) betajaen Coders. Blitz Basic 12 07 August 2018 17:36
Returning strings via ARexx port idrougge Coders. Scripting 11 09 October 2015 00:55
Concatenating strings? christopherpm Coders. Asm / Hardware 10 10 July 2013 19:43
Strange debugger strings for DFx.... Alexco support.WinUAE 1 27 May 2009 22:21
Splitting files mikni support.Apps 4 19 September 2001 14:51

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.06385 seconds with 15 queries