Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] to-string do question?

From: bry::itnisk::com at: 22-Jul-2003 12:10

I would like to do a string, the result of that do operation I would then like to convert to-string. From the console
>> thisstring: "1 + 5"
== "1 + 5"
>> do thisstring
== 6
>> thisstring: "write %newfile.txt read %result.txt"
== "write %newfile.txt read %result.txt"
>> do thisstring >> thisstring: "1 + 5"
== "1 + 5"
>> to-string do thisstring
== "6"
>> thisstring: "write %newfile.txt read %result.txt"
== "write %newfile.txt read %result.txt"
>> to-string do thisstring
** Script Error: to-string is missing its value argument ** Where: halt-view ** Near: to-string do thisstring
>>
so what I would like is someway of having do return "True" or "False" if do does not produce any output. I was thinking it might be possible to have a function that did the following: if do returns error returnstring = "False" else if to-string do thisstring returns error then returnstring = "True" else returnstring = to-string do thisstring. However I wanted to ask before I start writing the code as I thought I might be missing something.