type PlayerData:
record
xpos: int
ypos: int
xpos_width: int
xpos_height: int
color1: int
jump_speed: real
run_speed: real endrecord var new_data, old_data : PlayerData
% init all values
old_data.xpos :=0
old_data.ypos :=0 % ... etc.
function do_stuff_to(local_data : PlayerData)
local_data.ypos +=1
local_data.xpos_width +=1 % etc... result local_data
end do_stuff_to
Thanks a ton guys. I got frustrated and took a break for a few days, and I've come back with a clear mind and figured it out(: .. Much thanks!! (Really don't know where I'd be without you!)
Thankyou demon! And yes, I suppose I didn't check get, only string... =/ Sorry about that; I didnt think that get would have a specific syntax/parameter for strings w/ spaces
I've run into another hindrance... Although this one may be a bit over my head; I'm working on a program that I can put information into and it will format it for me. (Ughh, all the work, so much easier to program it(: ) The file is at the bottom here [VERY self explanatory. The file is written simply, and I have no need to make it more compact; it will never be used for another purpose/ or be expanded on.]
I've come to a problem. The program works (and does quite well). However, to make my life easier, I'd like to have it paste the information it gives me straight into a .docx file. [Why copy and paste when I can make the computer do it for me?] My problem, though, is that when i try to do this it corrupts my .docx file. Is there anything I can do about this? Does it happen in most languages, or is turing just lame? Here is the example coding I was using to test.
Turing:
var ws_doc :int open: ws_doc, "wss.docx",put% I've already created this file and I located it in the same folder as the program is in. put: ws_doc, "Blah blah blah"% I also went about putting a comma at the end of the "" and adding a variable there to see if I could input both in the same line. However that is irrelevant. close: ws_doc
I also tried the above using the write command instead of the put commands, I had the same result.
Posted: Tue Sep 27, 2011 7:38 am Post subject: RE:Importing Modules
The issue is that docx files are not plain text, they are binary files. Unless you know the encoding for the format (which I'm sure you could Google but it'd be a hell of a lot easier to copy/paste) you can't really do this with turing.... come to think of it it still may not be possible as there are some characters that turing cannot handle...
tl;dr just copy/paste
Sponsor Sponsor
DemonWasp
Posted: Tue Sep 27, 2011 7:54 am Post subject: RE:Importing Modules
In particular, all of the Office Open XML (not to be confused with OpenOffice XML) formats are zipped file formats. That means that, to even read the underlying XML, you would need to implement unzipping in Turing.
Once you have that, you would have to read and understand the existing document. The specification for how to do this is about 6,000 pages long, as I recall.
Then you would have to modify the document, push it all out as XML and then zip it again.
Posted: Sun Oct 02, 2011 11:43 am Post subject: RE:Importing Modules
I've been playing around a lot with having turing open/close things [internet explorers, executables, facebook.. etc.] and I've decided to try and write a tutorial on Turing about Turing because I want to help some of my friends learn the language.
However I'm running into the problem with them needing to run it with administrative privileges. Now, that isn't a problem [they trust me] but what is a problem is it's really annoying to right click and run as admin. Is there a way I can make it ask them for admin privledges when they run it? (Like the little popup window with the allow/disallow thing)
Do I do this in the coding of the program, or do i manually edit the properties of the .exe to 'run as admin'? (will it work when i send it to their computers?)
Nick
Posted: Mon Oct 03, 2011 10:36 am Post subject: RE:Importing Modules
Right click turing.exe -> properties -> compatibility mode -> run this as an administrator