April 28, 2024, 12:50:32 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Creating Data Statements in Text (or other) files

Started by AdrianFox, December 08, 2010, 11:24:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AdrianFox

Don't know if this is of any use to anybody else, but in my idiosyncratic world of programming, I often put a lot of text inside my programs as 'Data' statements which are put in an include file for reading in the program.

This little utility just takes the text or whatever file and puts the databegin mydata statement at the beginning, dataend at the end and encloses each line in data " ......"
It puts a double new line symbol "\n\n" on each empty line.

Anyway, here it is in the attached zip file.

Adrian Fox

Ficko

It is nice Adrian and very useful for Basic interpreters but since IWB is a compiler you can do it directly without any vias like: :D


DECLARE MyData()
OPENCONSOLE
PRINT *<STRING>&MyData
WAITCON
END

_asm
segment .const
MyData:
incbin"Input.txt"
db 0
_endasm

AdrianFox

Thanks for the information, Ficko.
I sort of guessed there must be a simpler way of doing it.
It's a long slow learning curve for some of us, but every bit helps.
;)
Adrian Fox