Postby djjb » 19. Nov 08, 08:09 
			
			
			
			Hi again,
It seems like I'm not trying enough, but I realy don't know a thing about this hahahaha.
You told me what to do, but I don't know how to do...lol.
>SilverEagle wrote:
> Now when adding a msg, check for all elements in
> the array if that name equals the element. If
> none matched, add the new name to the array.
How do I check?
I tried the string.match(regexp); and also downloaded the regexp.test(input); script and see how it works, But I got lost..
This is what I have now. And I think it's just a 'if' thing that must be set intro the script, or am I wrong?
<script>
    // this is just run once on startup
    var msglist = new Array("", "", "", "")
    var personlist = new Array("", "", "", "")
    program.addMenuEntry('Bericht', verzoekCallback);
    // end startup code
    function verzoekCallback()
    {
        var d = new Dialog;
        var i;
        var p;
        d.addStaticText('Text','Type hieronder een kort bericht van ongeveer 30 karakters. Je kunt je bericht lezen als het scherm wisselt (F1-toets)');
        d.addTextCtrl('Naam',' naam:');
        d.addStaticText(' Druk de Tab-toets om van naam naar bericht te gaan')
        d.addTextCtrl('Bericht',' bericht:');
        d.addButton('ok');
        d.addButton('cancel');
        if(d.showModal()=='ok')
        {
            // disbled just just for testing, i'm too lazy to click OK
            // alert('Bedankt!\nDruk op de F1-toets om je bericht te bekijken.\nOok bij het wisselen van nummers kan iedereen jouw bericht lezen.')
            for (i=3; i > 0; --i)
            {
                msglist[i] = msglist[i - 1];
            }
            msglist[0] = d.getValue('Naam') + ": " + d.getValue('Bericht');
            for (i=3; i >= 0; --i)
            {
            program.setSkinText("msg" + i, msglist[i]);
            } 
{
            for (p=3; p > 0; --p)
            {
                personlist[p] = personlist[p - 1];
            }
            personlist[0] = d.getValue('Naam');
            for (p=3; p >= 0; --p)
            {
            program.setSkinText("person" + p, personlist[p]);
            } 
}
    }
}
</script>
Sorry I'm a dummie.
I think I have to paste your logo in my skin...
Best regards,
John