Welcome to %s forums

BrainModular Users Forum

Login Register

comma text and string const

I need help on a Patch
Post Reply
23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 05 Jun 2010, 04:41

I have something i can't get my head on:

I made a script that has a commaIn, and now the comma don't work anymore, the script ignore it.

if i unwire my comma and type ie A,B,C, direcly on the script, it works and catch comma change.
if i copy the same exact text in a ptTextfield or reproduce in listBox , it doesn't work anymore...It was working previously I have no idea
where comes the pb from. Iwent too fast on changing manypart of the script so i couldn't debug,
but i have the feeling it started not working when i set a string constant using ie:
Module_name : 'cell';
the console shown me some unicode asking or well i don't remember exactly but shown me an error, but then it compiled.

could it be somehow related or any ideas? arf turning around from two hours..

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 05 Jun 2010, 05:34

so no
I could get rid of my pb by creating a new input, so that's cool, but I really can't understand and i hate that lol:
isn't it strange that, here are my booth input:
comma_0 := createParam('commain',PtTextField); setisOutput(comma_0,false);
comma := createParam('comma',PtTextField); setisOutput(comma,false);
now then if i wire my comma out of listbox on first, i see nothing on the script: [comma_0]
if i wire on second it shows: [comma] a,b,"c ok"
MMMMMMMMmmm

also I notice that if i remove the first input, making 'comma' being first and only, it doesn't work anymore, as if my first input was somehow corrupt.

bsork, senso help! any explain? now I start to put somes viruses on my inputs arf:D

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 05 Jun 2010, 14:03

Could you perhaps post the whole patch?
Bjørn S

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 05 Jun 2010, 18:55

yup in fact it's the add-on Auto-combo, you can see on script there is the two comma in.

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 07 Jun 2010, 22:47

I've had a look, but can't say I found out what's wrong. I found out however that when I connected something to the first parameter of the inputs (no matter if I had changed the order of them), there was a (infinite?) loop of callbacks on that input when I connected something to it.

Changing the data type of the first input made the callback behave ok, but changing type for the second instead was just as bad. I also tried to create a mini-script with only two ptTextField inputs in case there's a bug when that data type is used in the first input, but that one behaved well.

Deleting comments at the top didn't help either (remembering when years ago I spent quite some with because of some troublesome character in a C program at work). Changed some other things around a bit, but still the callbacks started every time something was connected to the first input.:(
Bjørn S

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 07 Jun 2010, 23:36

thanks for taking time checking bsork. i couldn't find as well.....

usually got such infinite callbacks when input Min/max are wrong related to what's comming in, but that shouldn't apply on text ?..
I first felt it was related to when i tried to create some string constants, maybe that changed som text interpreting...
maybe need to reforce some min/max or i don't know.... what is stange is anyway i deleted those string constants, so on a fresh new open/compile ie on your computer, there should have no traces of that, unless it's save in the wkp or .pat....
mmmmmm something else..., but what? Arf... maybe some size set, or I notice that most usine modules use input0 as visibility, maybe i triggered something wrong related to that, don't know at all where to search anymore, standby for now...
anyway not drastic, just want to understand my error, i can't stand making errors i don't understand. hehe
so back to work..

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 08 Jun 2010, 07:55

23fx23 wrote:i can't stand making errors i don't understand. hehe
I forgot to do the most obvious test: Copying the script into an empty patch. Well - it didn't help... But maybe you're on to something with the input 0 as visible thing? Or min/max?

Senso - any comments?
Bjørn S

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 10 Jun 2010, 21:20

I'll take a look on the script :)

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 11 Jun 2010, 15:41

It's a misspelling pb.

[c] comma_0 := createParam('commain',PtTextField);
setisOutput(comma_0,false);
comma := createParam('comma',PtTextField);
setisOutput(comma,false);
NextPage:= createParam('NextPage',PtDataField);
setisOutput(NextPage,false);
PrevPage:= createParam('PrevPage',PtDataField);
setisOutput(PrevPage,false);
Reset := createParam('Reset',PtDataField);
setisOutput(Reset,false);
Mode := createParam('Mode',PtDataField);
setisOutput(Mode,false);
MSDWNZ := createParam('MSDWNZ',PtArray);
setisOutput(MsdwnZ,false);
setmin(msdwnZ,0); // instead of setmin(msdwn,0);
setmax(msdwnZ,1); // instead of setmin(msdwn,0);
[/c]

Don't forget that Parameter variables are in fact integers.
[c]comma_0 = 0
comma = 1
NextPage = 2
...
MsdwnZ=6
[/c]

at the concerned line if you enter Msdwn instead of MsdwnZ you set the parameter 0 instead of 6.

[c]setmin(msdwn,0);
// is equivalent to
setmin(0,0);
// which is equivalent to
setmin(comma_0,0);
[/c]

I hope you understand because it's tricky...

so you change the min/max values of comma_0, not on MsdwnZ
on text events min=1 and max=16384 (unicode values)
after your both misspelling lines the comma_0 min=0 and max=1.
So Usine can't affect this param properly and retry on each patch processing bloc.

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 11 Jun 2010, 16:59

woa so many thanks olivier!!!!!!!!!!!, how could i missed that error, anyway i would'nt have understood wrong name would affect input 0. (mm i have a msdwn output also on the script); Ahh ok as prev line is input but max refering to output0 it affect input0 ...got to check that asap

thank ya so much for the solving and explain!

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 14 Jun 2010, 08:24

...and I was even looking for some naming errors like that! :(

Well spotted, Olovier! :)
Bjørn S

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests