Stopping a string
#1

Right fellas! I making a code which uses a "next page" & "previous page" function, but I can't figure out how to stop a string from processing, i've tried using EOS but, had no luck. Here's an example;

- Item 1.
- Item 2.
- Item 3.
- Next Page.
Reply
#2

Please show us some code.
Reply
#3

Why would I need to show code? I just asked for an example. I'd rather not give part of my code.
Reply
#4

I don't get what exactly ur Tring to do!
Explain more ?
What u mean stop a string from processing ? What/how is it processing ?
Edit
Inserting \0 end of string wouldn't really stop it as that is to indicate the end of it for functions to know when to finish checking etc.
Reply
#5

Here's the code.
pawn Код:
new String[950], String1[155];
    switch(dealerid) {
        case 3: {
            for(new i = pageNum; i != sizeof medClass; i++) {
                format(String1, sizeof String1, "{FFFFFF}%d\t{BE69FF}%s {21DB00}$%s", i, VehicleNames[medClass[i][dModel] - 400], number_format(medClass[i][dPrice]));
                strcat(String, "\n");
                if(i >= 10) {
                    strcat(String, "\n\n");
                    strcat(String, "Next Page >>");
                }
                strcat(String, String1);
                String[0] = EOS;
            }
            ShowPlayerDialog(playerid, DIALOG_LOW_DEALER, DIALOG_STYLE_LIST, "Low Class Dealership", String, "Purchase", "Cancel");
        }
    }
Reply
#6

You are actually NULL terminating the "String" string at it's first character. And I don't see a point using "\n\n" in a list dialog.
Reply
#7

There is a better way in doing this but I can't show u now.
pawn Код:
new String[950], String1[155];
    switch(dealerid) {
        case 3: {
            for(new i = pageNum; i != sizeof medClass; i++) {
                format(String1, sizeof String1, "{FFFFFF}%d\t{BE69FF}%s {21DB00}$%s/n", i, VehicleNames[medClass[i][dModel] - 400], number_format(medClass[i][dPrice]));
                strins(String,String1,0);
                if(i >= 9) {
                    strins(String, "Next Page >>",strlen(String));
                    break;
                }
            }
            ShowPlayerDialog(playerid, DIALOG_LOW_DEALER, DIALOG_STYLE_LIST, "Low Class Dealership", String, "Purchase", "Cancel");
        }
    }
then u need to figure out how ur data is stored some showe the next page,
I migh done so mistakes as I'm on the phone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)