PageMac
Home
   dot Projects
   dot Pics and Images
   dot WREK
D++
   dot About / FAQ
   dot Download
   dot Code Library
   dot Documentation
   dot VB6 Runtime Files
About

  Source Code - dpp/source/switch.dpp

Download link (right click, save as)



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
function main()
{
    newvar z;
    
    screenput "Enter a number: ";
    screenin z; screen; screen;
    
    switch z;
        case 1:
            screenput "one!";
        case 2:
            screenput "two!";
            screen;
            switch z + rndnum(2);
                case 2:
                    screenput "same!";
                case 3:
                    screenput "one more!";
                case 4:
                    screenput "yeah! two more!";
            endswitch;
        case 3:
            screenput "three!";
        case 4:
            screenput "four!";
        default:
            screenput "wtf is that?";
    endswitch;
}


This code is Copyright (C) 2000-2012 PageMac Programming. Reproduction of this code must adhere to the GNU General Public License.