35 lines
1 KiB
Text
35 lines
1 KiB
Text
#11 = 0 // needspeeling = FALSE
|
|
#12 = 0 // seedsremoved = FALSE
|
|
Reg_Empty(21) // fullname
|
|
Reg_Empty(22) // favouritefruit
|
|
Reg_Empty(23) // otherfamily
|
|
|
|
File_Open("|(PATH_ONLY)\example.cfg")
|
|
|
|
if (Search("|<FULLNAME|s", BEGIN+ADVANCE+NOERR)) {
|
|
Match("=", ADVANCE) // skip optional '='
|
|
Reg_Copy_Block(21, CP, EOL_pos)
|
|
}
|
|
if (Search("|<FAVOURITEFRUIT|s", BEGIN+ADVANCE+NOERR)) {
|
|
Match("=", ADVANCE)
|
|
Reg_Copy_Block(22, CP, EOL_pos)
|
|
}
|
|
if (Search("|<OTHERFAMILY|s", BEGIN+ADVANCE+NOERR)) {
|
|
Match("=", ADVANCE)
|
|
Reg_Copy_Block(23, CP, EOL_pos)
|
|
}
|
|
if (Search("|<NEEDSPEELING|s", BEGIN+ADVANCE+NOERR)) {
|
|
#11 = 1
|
|
}
|
|
if (Search("|<SEEDSREMOVED|s", BEGIN+ADVANCE+NOERR)) {
|
|
#12 = 1
|
|
}
|
|
|
|
Buf_Quit(OK) // close .cfg file
|
|
|
|
// Display the variables
|
|
Message("needspeeling = ") Num_Type(#11, LEFT)
|
|
Message("seedsremoved = ") Num_Type(#12, LEFT)
|
|
Message("fullname = ") Reg_Type(21) TN
|
|
Message("favouritefruit = ") Reg_Type(22) TN
|
|
Message("otherfamily = ") Reg_Type(23) TN
|