// D-BASE64.VDM -- Decode Base64 Text - the 'Right Brain' method :-) // // Date: 05/09/2004 // // Requires: VEDIT 6.12 or later. // // The Starving Hedonist - http://cu2.home.comcast.net // // ---------------------------------------- #10 = Buf_Num #11 = Buf_Switch(Buf_Free()) File_Open_Write("D-STAGE1.TXT",OVERWRITE|NOEVENT) Buf_Switch(#10) BOF() While (! AT_EOF) { Statline_Message("Stage 1 Processing: |@(10)") Set_Marker(1,BOL_Pos) Set_Marker(2,EOL_Pos) Reg_Copy_Block(10,Marker(1),Marker(2)) #50 = Reg_Size(10) Buf_Switch(#11) Ins_Text(@10) if (#50 >= 4) { While (#50 >= 4) { BOL Goto_Col(5) Ins_Newline(1) EOL if (Cur_Col>=4) { Goto_Col(5) Ins_Newline(1) EOL } #50 = Cur_Col } } Buf_Switch(#10) Line(1,NOERR) } // ---------------------------------------- #12 = Buf_Switch(Buf_Free()) File_Open_Write("D-STAGE2.TXT",OVERWRITE|NOEVENT) Buf_Switch(#11) BOF() While (! AT_EOF) { Statline_Message("Stage 2 Processing: |@(10)") While (! AT_EOL) { if (Cur_Char(0) == 'A') { Buf_Switch(#12) Ins_Text(" ") Ins_Text(".") } if (Cur_Char(0) == 'B') { Buf_Switch(#12) Ins_Text(" X") Ins_Text(".") } if (Cur_Char(0) == 'C') { Buf_Switch(#12) Ins_Text(" X ") Ins_text(".") } if (Cur_Char(0) == 'D') { Buf_Switch(#12) Ins_Text(" XX") Ins_Text(".") } if (Cur_Char(0) == 'E') { Buf_Switch(#12) Ins_Text(" X ") Ins_Text(".") } if (Cur_Char(0) == 'F') { Buf_Switch(#12) Ins_Text(" X X") Ins_Text(".") } if (Cur_Char(0) == 'G') { Buf_Switch(#12) Ins_Text(" XX ") Ins_Text(".") } if (Cur_Char(0) == 'H') { Buf_Switch(#12) Ins_Text(" XXX") Ins_Text(".") } if (Cur_Char(0) == 'I') { Buf_Switch(#12) Ins_Text(" X ") Ins_Text(".") } if (Cur_Char(0) == 'J') { Buf_Switch(#12) Ins_Text(" X X") Ins_Text(".") } if (Cur_Char(0) == 'K') { Buf_Switch(#12) Ins_Text(" X X ") Ins_Text(".") } if (Cur_Char(0) == 'L') { Buf_Switch(#12) Ins_Text(" X XX") Ins_Text(".") } if (Cur_Char(0) == 'M') { Buf_Switch(#12) Ins_Text(" XX ") Ins_Text(".") } if (Cur_Char(0) == 'N') { Buf_Switch(#12) Ins_Text(" XX X") Ins_Text(".") } if (Cur_Char(0) == 'O') { Buf_Switch(#12) Ins_Text(" XXX ") Ins_Text(".") } if (Cur_Char(0) == 'P') { Buf_Switch(#12) Ins_Text(" XXXX") Ins_Text(".") } if (Cur_Char(0) == 'Q') { Buf_Switch(#12) Ins_Text(" X ") Ins_Text(".") } if (Cur_Char(0) == 'R') { Buf_Switch(#12) Ins_Text(" X X") Ins_Text(".") } if (Cur_Char(0) == 'S') { Buf_Switch(#12) Ins_Text(" X X ") Ins_Text(".") } if (Cur_Char(0) == 'T') { Buf_Switch(#12) Ins_Text(" X XX") Ins_Text(".") } if (Cur_Char(0) == 'U') { Buf_Switch(#12) Ins_Text(" X X ") Ins_Text(".") } if (Cur_Char(0) == 'V') { Buf_Switch(#12) Ins_Text(" X X X") Ins_Text(".") } if (Cur_Char(0) == 'W') { Buf_Switch(#12) Ins_Text(" X XX ") Ins_Text(".") } if (Cur_Char(0) == 'X') { Buf_Switch(#12) Ins_Text(" X XXX") Ins_Text(".") } if (Cur_Char(0) == 'Y') { Buf_Switch(#12) Ins_Text(" XX ") Ins_Text(".") } if (Cur_Char(0) == 'Z') { Buf_Switch(#12) Ins_Text(" XX X") Ins_Text(".") } if (Cur_Char(0) == 'a') { Buf_Switch(#12) Ins_Text(" XX X ") Ins_Text(".") } if (Cur_Char(0) == 'b') { Buf_Switch(#12) Ins_Text(" XX XX") Ins_Text(".") } if (Cur_Char(0) == 'c') { Buf_Switch(#12) Ins_Text(" XXX ") Ins_Text(".") } if (Cur_Char(0) == 'd') { Buf_Switch(#12) Ins_Text(" XXX X") Ins_Text(".") } if (Cur_Char(0) == 'e') { Buf_Switch(#12) Ins_Text(" XXXX ") Ins_Text(".") } if (Cur_Char(0) == 'f') { Buf_Switch(#12) Ins_Text(" XXXXX") Ins_Text(".") } if (Cur_Char(0) == 'g') { Buf_Switch(#12) Ins_Text("X ") Ins_Text(".") } if (Cur_Char(0) == 'h') { Buf_Switch(#12) Ins_Text("X X") Ins_Text(".") } if (Cur_Char(0) == 'i') { Buf_Switch(#12) Ins_Text("X X ") Ins_Text(".") } if (Cur_Char(0) == 'j') { Buf_Switch(#12) Ins_Text("X XX") Ins_Text(".") } if (Cur_Char(0) == 'k') { Buf_Switch(#12) Ins_Text("X X ") Ins_Text(".") } if (Cur_Char(0) == 'l') { Buf_Switch(#12) Ins_Text("X X X") Ins_Text(".") } if (Cur_Char(0) == 'm') { Buf_Switch(#12) Ins_Text("X XX ") Ins_Text(".") } if (Cur_Char(0) == 'n') { Buf_Switch(#12) Ins_Text("X XXX") Ins_Text(".") } if (Cur_Char(0) == 'o') { Buf_Switch(#12) Ins_Text("X X ") Ins_Text(".") } if (Cur_Char(0) == 'p') { Buf_Switch(#12) Ins_Text("X X X") Ins_Text(".") } if (Cur_Char(0) == 'q') { Buf_Switch(#12) Ins_Text("X X X ") Ins_Text(".") } if (Cur_Char(0) == 'r') { Buf_Switch(#12) Ins_Text("X X XX") Ins_Text(".") } if (Cur_Char(0) == 's') { Buf_Switch(#12) Ins_Text("X XX ") Ins_Text(".") } if (Cur_Char(0) == 't') { Buf_Switch(#12) Ins_Text("X XX X") Ins_Text(".") } if (Cur_Char(0) == 'u') { Buf_Switch(#12) Ins_Text("X XXX ") Ins_Text(".") } if (Cur_Char(0) == 'v') { Buf_Switch(#12) Ins_Text("X XXXX") Ins_Text(".") } if (Cur_Char(0) == 'w') { Buf_Switch(#12) Ins_Text("XX ") Ins_Text(".") } if (Cur_Char(0) == 'x') { Buf_Switch(#12) Ins_Text("XX X") Ins_Text(".") } if (Cur_Char(0) == 'y') { Buf_Switch(#12) Ins_Text("XX X ") Ins_Text(".") } if (Cur_Char(0) == 'z') { Buf_Switch(#12) Ins_Text("XX XX") Ins_Text(".") } if (Cur_Char(0) == '0') { Buf_Switch(#12) Ins_Text("XX X ") Ins_Text(".") } if (Cur_Char(0) == '1') { Buf_Switch(#12) Ins_Text("XX X X") Ins_Text(".") } if (Cur_Char(0) == '2') { Buf_Switch(#12) Ins_Text("XX XX ") Ins_Text(".") } if (Cur_Char(0) == '3') { Buf_Switch(#12) Ins_Text("XX XXX") Ins_Text(".") } if (Cur_Char(0) == '4') { Buf_Switch(#12) Ins_Text("XXX ") Ins_Text(".") } if (Cur_Char(0) == '5') { Buf_Switch(#12) Ins_Text("XXX X") Ins_Text(".") } if (Cur_Char(0) == '6') { Buf_Switch(#12) Ins_Text("XXX X ") Ins_Text(".") } if (Cur_Char(0) == '7') { Buf_Switch(#12) Ins_Text("XXX XX") Ins_Text(".") } if (Cur_Char(0) == '8') { Buf_Switch(#12) Ins_Text("XXXX ") Ins_Text(".") } if (Cur_Char(0) == '9') { Buf_Switch(#12) Ins_Text("XXXX X") Ins_Text(".") } if (Cur_Char(0) == '+') { Buf_Switch(#12) Ins_Text("XXXXX ") Ins_Text(".") } if (Cur_Char(0) == '/') { Buf_Switch(#12) Ins_Text("XXXXXX") Ins_Text(".") } if (Cur_Char(0) == '=') {} // need to check behaviour Buf_Switch(#11) Char(1) } Buf_Switch(#12) Ins_Newline(1) Buf_Switch(#11) Line(1) } // ---------------------------------------- #13 = Buf_Switch(Buf_Free()) File_Open_Write("D-STAGE3.TXT",OVERWRITE|NOEVENT) Buf_Switch(#12) BOF() While (! AT_EOF) { Statline_Message("Stage 3 Processing: |@(10)") Set_Marker(1,Cur_Pos) Set_Marker(2,EOL_Pos) Reg_Copy_Block(10,Marker(1),Marker(2)) Buf_Switch(#13) Ins_Text(@10) Ins_Newline(1) Buf_Switch(#12) Line(1) } Buf_Switch(#13) Replace(".","",BEGIN|ALL|NOERR) // ---------------------------------------- #14 = Buf_Switch(Buf_Free()) File_Open_Write("D-STAGE4.TXT",OVERWRITE|NOEVENT) Buf_Switch(#13) BOF() While (! AT_EOF) { Statline_Message("Stage 4 Processing: |@(10)") Set_Marker(1,Cur_Pos) Set_Marker(2,EOL_Pos) Reg_Copy_Block(10,Marker(1),Marker(2)) #50 = Reg_Size(10) Buf_Switch(#14) Ins_Text(@10) BOL for (#50/=8;#50!=0;#50--) { Char(8) Ins_Text(".") } EOL Ins_Newline(1) Buf_Switch(#13) Line(1) } // ---------------------------------------- #15 = Buf_Switch(Buf_Free()) File_Open_Write("D-STAGE5.TXT",OVERWRITE|NOEVENT) Buf_Switch(#14) BOF() While (! AT_EOF) { Statline_Message("Stage 5 Processing: |@(10)") Search(".",ERRBREAK) Char(-8) if (Match("|{X,|B}|{X,|B}|{X,|B}|{X,|B}|{X,|B}|{X,|B}|{X,|B}|{X,|B}.")==0) { Set_Marker(1,Cur_Pos) Set_Marker(2,Cur_Pos+8) Reg_Copy_Block(10,Marker(1),Marker(2)) } else { StatLine_Message("ERROR: STAGE5") Buf_Switch(#15) return } Buf_Switch(Buf_Free(EXTRA)) #50 = 0 Ins_Text(@10) BOL if (Cur_Char != 32) { #50 += 128 } Char(1) if (Cur_Char != 32) { #50 += 64 } Char(1) if (Cur_Char != 32) { #50 += 32 } Char(1) if (Cur_Char != 32) { #50 += 16 } Char(1) if (Cur_Char != 32) { #50 += 8 } Char(1) if (Cur_Char != 32) { #50 += 4 } Char(1) if (Cur_Char != 32) { #50 += 2 } Char(1) if (Cur_Char != 32) { #50 += 1 } Buf_Quit(OK) Buf_Switch(#15) Ins_Char(#50) Buf_Switch(#14) Char(10) } Reg_Empty(10) Buf_Switch(#11) Buf_Quit(OK) Buf_Switch(#12) Buf_Quit(OK) Buf_Switch(#13) Buf_Quit(OK) Buf_Switch(#14) Buf_Quit(OK) Buf_Switch(#15) BOF Statline_Message("Done!") return