Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/tutorial_samples/12_WriteStr.py
blob: 1dcc15505e68eb87406b6d5c25a2d8dcd8832cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
DEFINE OK=LDR_SUCCESS


def main():
    
    fileHandle=Byte()
    fileSize=Short()
    bytesWritten=Short()
    
    read=String()
    write=String()
    error=String()
    
    tmp=String()
    
    DeleteFile("Danny.txt")
    DeleteFile("DannySays.txt")
    CreateFile("Danny.txt", 512, fileHandle)
    for i in range(2,10):
        write = "NXT is cool "
        tmp = NumToStr(i)
        write = StrCat(write,tmp," times!")
        WriteLnString(fileHandle,write, bytesWritten)
    
    CloseFile(fileHandle)
    RenameFile("Danny.txt","DannySays.txt")