0 Members and 1 Guest are viewing this topic.

:sub(VI)::Lbl L:If sub(VT)=5: For(A,1,sub(VNL)): Disp {sub(VN)-A+1}>Char: End: Disp i:End:If sub(VNX): Goto L:End:Return::.Initialize Vat pointer (using P as pointer):Lbl VI:{E9830}r->P:Return::.Get Next Entry:.Returns 1 if End of Vat or 0 otherwise:Lbl VNX:P-{P-6}-7->P>={E982E}r:Return::.Get current entry type:Lbl VT:{P}:Return::.Get Pointer to current name length:Lbl VNL:{P-6}:Return::.Get Pointer to current entry name (backwards):Lbl VN:P-7:Return

If I want to store something into an appvar pointed to by Z, but start at position 1 instead of position 0, would i doA->Z+1or A->{Z+1

Quote from: ACagliano on October 07, 2010, 12:11:23 pmIf I want to store something into an appvar pointed to by Z, but start at position 1 instead of position 0, would i doA->Z+1or A->{Z+1A->{Z+1}

So, a DCS user with four folders on their calc would look like this:prgm%FLD[1]prgm%FLD[2]prgm%FLD[3]prgm%FLD[4]

:"%FLD["->Str1:sub(VI)::Goto A:Repeat sub(VNX):Lbl A:For(A,0,4):If {P+A-6}!={Str1+A}:Goto B:End:End:{P-1}->{L1}:If {L1}>{L1+1}:{L1}->{L1+1}:End:Lbl B:End:{L1}-48->L1:Return::.Initialize Vat pointer (using P as pointer):Lbl VI:{E9830}r->P:Return::.Get Next Entry:.Returns 1 if End of Vat or 0 otherwise:Lbl VNX:P-{P-6}-7->P>={E982E}r:Return::.Get current entry type:Lbl VT:{P}:Return::.Get Pointer to current name length:Lbl VNL:{P-6}:Return::.Get Pointer to current entry name (backwards):Lbl VN:P-7:Return

Would this work:Code: [Select]:"%FLD["->Str1:sub(VI)::Goto A:Repeat sub(VNX):Lbl A:For(A,0,4):If {P+A-6}!={Str1+A}:Goto B:End:End:{P-1}->{L1}:If {L1}>{L1+1}:{L1}->{L1+1}:End:Lbl B:End:{L1}-48->L1:Return::.Initialize Vat pointer (using P as pointer):Lbl VI:{E9830}r->P:Return::.Get Next Entry:.Returns 1 if End of Vat or 0 otherwise:Lbl VNX:P-{P-6}-7->P>={E982E}r:Return::.Get current entry type:Lbl VT:{P}:Return::.Get Pointer to current name length:Lbl VNL:{P-6}:Return::.Get Pointer to current entry name (backwards):Lbl VN:P-7:ReturnL1 should hold the number of the highest folder, but my routine only should work for the first 10 folders.

:.VATCHK:"%FLD"->Str1 // That [ shouldn't be there. It was a representation on my part.:sub(VI):0->{L1+1}::Goto A:Repeat sub(VNX):Lbl A:For(A,0,4):If {P+A-6}!={Str1+A}:Goto B:End:End:{P-1}->{L1}:If {L1}>{L1+1}:{L1}->{L1+1}:End:Lbl B:End:{L1}-48->L1:Return::.Initialize Vat pointer (using P as pointer):Lbl VI:{E9830}r->P:Return::.Get Next Entry:.Returns 1 if End of Vat or 0 otherwise:Lbl VNX:P-{P-6}-7->P>={E982E}r:Return::.Get current entry type:Lbl VT:{P}:Return::.Get Pointer to current name length:Lbl VNL:{P-6}:Return::.Get Pointer to current entry name (backwards):Lbl VN:P-7:Return

:.VATCHK:"%FLD"->Str1 // That [ shouldn't be there. It was a representation on my part.:sub(VI):0->{L1+1}::Goto A:Repeat sub(VNX):Lbl A:For(A,0,3):If {P-A-6}!={Str1+A}:Goto B:End:End:{P-10}->{L1}:If {L1}>{L1+1}:{L1}->{L1+1}:End:Lbl B:End:{L1}-48->L1:Return::.Initialize Vat pointer (using P as pointer):Lbl VI:{E9830}r->P:Return::.Get Next Entry:.Returns 1 if End of Vat or 0 otherwise:Lbl VNX:P-{P-6}-7->P>={E982E}r:Return::.Get current entry type:Lbl VT:{P}:Return::.Get Pointer to current name length:Lbl VNL:{P-6}:Return::.Get Pointer to current entry name (backwards):Lbl VN:P-7:Return