$APPTYPE CONSOLE
SUBI PRINTF (...)
N = 1
M = 2
FOR I = 1 TO LEN(PARAMSTR$(1))
SELECT CASE MID$(PARAMSTR$(1), I, 1)
CASE "%"
I = I + 1
SELECT CASE LCASE$(MID$(PARAMSTR$(1), I, 1))
CASE "d"
PRINT INT(PARAMVAL(N));
N = N + 1
CASE "f"
PRINT PARAMVAL(N);
N = N + 1
CASE IS = "l" AND LCASE$(MID$(PARAMSTR$(1), I+1, 1)) = "d"
PRINT INT(PARAMVAL(N));
N = N + 1
I = I + 1
CASE "s"
PRINT PARAMSTR$(M);
M = M + 1
CASE ELSE
PRINT MID$(PARAMSTR$(1), I-1, 2);
END SELECT
CASE "\"
I = I + 1
SELECT CASE LCASE$(MID$(PARAMSTR$(1), I, 1))
CASE "n"
PRINT
CASE ELSE
PRINT MID$(PARAMSTR$(1), I-1, 2);
END SELECT
CASE ELSE
PRINT MID$(PARAMSTR$(1), I, 1);
END SELECT
NEXT
END SUBI
CLS
PRINTF("Number: %d, string: %s and this is %5 undefined.\n", 123, "hello")
PRINTF "Num 1: %ld, Num 2: %f, Num 3: %d, Num 4: %d\n", 2^10-30/5*10, 498.234, 91, 100
|