[swift-users] read data from the code

Bee bee.ography at gmail.com
Sat Dec 12 00:46:51 CST 2015


Hi all,

Does anyone here remember gwbasic? There is one feature of gwbasic that I
miss from modern programming language. It's the pair of READ function and
DATA statement. An example here:
http://www.antonis.de/qbebooks/gwbasman/data.html

READ function is to read input from DATA statement. This is very helpful
when you need to test your code with specified set of data. Instead of
enter them via keyboard, you simply include the data along with the source
code without changing the code much. In gwbasic, you simply changes the
READ into INPUT function to read input from internal data to from user's
input by keyboard.

Of course, I could make a function to do something like that. But I need it
for teaching swift to complete beginners. I need the feature to be in
language level (as provided by gwbasic).

Is it available? Or is there any similar feature?

Thank you.

Regards,

-- 
-Bee-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151212/f667d856/attachment.html>


More information about the swift-users mailing list