07-12-2003, 03:24 AM
perhaps I'm understanding the problem wrong?
Doesn't this do what you described?
*peace*
Meg.
p.s. Making it read from DATA statements and write to a file can be done pretty simply.. I didn't realize that is what you wanted it to do. Just change the last PRINT to send to file, and read in the data before the first CALL.
Code:
DECLARE SUB PrintCombos (Lead$, Text$)
INPUT "Enter string: ", Text$
CALL PrintCombos("", Text$)
SUB PrintCombos (Lead$, Text$)
IF LEN(Text$) > 1 THEN
FOR CurrentLetter% = 1 TO LEN(Text$)
NewLead$ = Lead$ + MID$(Text$, CurrentLetter%, 1)
NewText$ = LEFT$(Text$, CurrentLetter% - 1) + RIGHT$(Text$, LEN(Text$) - CurrentLetter%)
CALL PrintCombos(NewLead$, NewText$)
NEXT CurrentLetter%
ELSE
PRINT Lead$ + Text$
END IF
END SUB
Doesn't this do what you described?
*peace*
Meg.
p.s. Making it read from DATA statements and write to a file can be done pretty simply.. I didn't realize that is what you wanted it to do. Just change the last PRINT to send to file, and read in the data before the first CALL.