ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2016-07-27T15:32:44+02:00 https://brainmodular.org/forums/app.php/feed/topic/5479 2016-07-27T15:32:44+02:00 2016-07-27T15:32:44+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35644#p35644 <![CDATA[What is the hh Pascal equivalent of chr()?]]> Statistics: Posted by ahonoe — 27 Jul 2016, 15:32


]]>
2016-07-26T20:17:06+02:00 2016-07-26T20:17:06+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35643#p35643 <![CDATA[What is the hh Pascal equivalent of chr()?]]> you're right the CHR is missing in the script engine. It will be corrected in the next major release.

the work arround is to create the CHR function yourself like bellow. Fully customizable

senso+++

CODE:

function MyCHR&#40;i&#58;integer&#41;&#58;Char;const S ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';begin  result &#58;= S&#91;i-40&#93;;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;begin  writeln&#40;MyChr&#40;41&#41;+MyChr&#40;42&#41;&#41;;end;

Statistics: Posted by senso — 26 Jul 2016, 20:17


]]>
2016-07-26T19:06:57+02:00 2016-07-26T19:06:57+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35642#p35642 <![CDATA[What is the hh Pascal equivalent of chr()?]]> I'll check in my archive for script I made using char and string...

Statistics: Posted by oli_lab — 26 Jul 2016, 19:06


]]>
2016-07-26T18:51:01+02:00 2016-07-26T18:51:01+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35641#p35641 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
1) appends the ascii value to my string rather than the acsii character
2) StrSet() looks interesting however hh throws an "Unknown declaration "StrSet"" error. Maybe this procedure hasn't been implement in hh?
3) char_arr is, by functional requirement, an array of singles though the values at the relevant index are always converted to integers (as they are ascii vals)

oli:

Same problem as #3 above. The array values are singles and can't be added to a string.

Thanks again for your suggestions. I do appreciate them.

Statistics: Posted by ahonoe — 26 Jul 2016, 18:51


]]>
2016-07-26T18:21:11+02:00 2016-07-26T18:21:11+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35640#p35640 <![CDATA[What is the hh Pascal equivalent of chr()?]]> S := S + ArrChar ?

Statistics: Posted by oli_lab — 26 Jul 2016, 18:21


]]>
2016-07-26T06:49:04+02:00 2016-07-26T06:49:04+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35639#p35639 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
There are three approaches I'd experiment with...

(1) Your example with a recast along the way... s := s+inttostr(char_arr);

(2) Loop StrSet's, e.g., StrSet(char_arr, x, s); Don't forget to do a SetLength somewhere in there

(3) Declare char_arr as a string to begin with

Dealing with small integers you may need to recast using trunc() or int() somewhere along the line...

Shawn

Statistics: Posted by shawnb — 26 Jul 2016, 06:49


]]>
2016-07-26T06:11:06+02:00 2016-07-26T06:11:06+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35638#p35638 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
To recap : I have an array of singles where each value represents an acsii character. I'm trying to convert this to a string. So I read each value in the array, round()ing it as I go. Now I want to convert each integer value to a char so I can append it to a string. In Pascal proper I'd use the chr() function but in hh that's not available. I guess my question really is how do I convert a single to a char.

Statistics: Posted by ahonoe — 26 Jul 2016, 06:11


]]>
2016-07-25T21:36:16+02:00 2016-07-25T21:36:16+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35635#p35635 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
In case you missed it, there's a very handy page on strings in the scripting language tutorial:
http://www.sensomusic.org/wiki3/doku.ph ... tutorial05

Look at the examples towards the bottom.

Statistics: Posted by shawnb — 25 Jul 2016, 21:36


]]>
2016-07-25T18:39:02+02:00 2016-07-25T18:39:02+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35634#p35634 <![CDATA[What is the hh Pascal equivalent of chr()?]]> ).

Thanks again.

Statistics: Posted by ahonoe — 25 Jul 2016, 18:39


]]>
2016-07-25T14:56:54+02:00 2016-07-25T14:56:54+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35632#p35632 <![CDATA[What is the hh Pascal equivalent of chr()?]]> I'm fact you treat the char as single

Var currentChar: single

...

currentChar := GetdataArrayvalue(input, Idx );

...

SetdataArrayvalue (output, Idx, currentChar) ;

Statistics: Posted by oli_lab — 25 Jul 2016, 14:56


]]>
2016-07-24T22:55:57+02:00 2016-07-24T22:55:57+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35626#p35626 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
Thanks for your help!

Statistics: Posted by ahonoe — 24 Jul 2016, 22:55


]]>
BrainModular BrainModular Users Forum 2016-07-27T15:32:44+02:00 https://brainmodular.org/forums/app.php/feed/topic/5479 2016-07-27T15:32:44+02:00 2016-07-27T15:32:44+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35644#p35644 <![CDATA[What is the hh Pascal equivalent of chr()?]]> Statistics: Posted by ahonoe — 27 Jul 2016, 15:32


]]>
2016-07-26T20:17:06+02:00 2016-07-26T20:17:06+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35643#p35643 <![CDATA[What is the hh Pascal equivalent of chr()?]]> you're right the CHR is missing in the script engine. It will be corrected in the next major release.

the work arround is to create the CHR function yourself like bellow. Fully customizable

senso+++

CODE:

function MyCHR&#40;i&#58;integer&#41;&#58;Char;const S ='ABCDEFGHIJKLMNOPQRSTUVWXYZ';begin  result &#58;= S&#91;i-40&#93;;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;begin  writeln&#40;MyChr&#40;41&#41;+MyChr&#40;42&#41;&#41;;end;

Statistics: Posted by senso — 26 Jul 2016, 20:17


]]>
2016-07-26T19:06:57+02:00 2016-07-26T19:06:57+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35642#p35642 <![CDATA[What is the hh Pascal equivalent of chr()?]]> I'll check in my archive for script I made using char and string...

Statistics: Posted by oli_lab — 26 Jul 2016, 19:06


]]>
2016-07-26T18:51:01+02:00 2016-07-26T18:51:01+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35641#p35641 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
1) appends the ascii value to my string rather than the acsii character
2) StrSet() looks interesting however hh throws an "Unknown declaration "StrSet"" error. Maybe this procedure hasn't been implement in hh?
3) char_arr is, by functional requirement, an array of singles though the values at the relevant index are always converted to integers (as they are ascii vals)

oli:

Same problem as #3 above. The array values are singles and can't be added to a string.

Thanks again for your suggestions. I do appreciate them.

Statistics: Posted by ahonoe — 26 Jul 2016, 18:51


]]>
2016-07-26T18:21:11+02:00 2016-07-26T18:21:11+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35640#p35640 <![CDATA[What is the hh Pascal equivalent of chr()?]]> S := S + ArrChar ?

Statistics: Posted by oli_lab — 26 Jul 2016, 18:21


]]>
2016-07-26T06:49:04+02:00 2016-07-26T06:49:04+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35639#p35639 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
There are three approaches I'd experiment with...

(1) Your example with a recast along the way... s := s+inttostr(char_arr);

(2) Loop StrSet's, e.g., StrSet(char_arr, x, s); Don't forget to do a SetLength somewhere in there

(3) Declare char_arr as a string to begin with

Dealing with small integers you may need to recast using trunc() or int() somewhere along the line...

Shawn

Statistics: Posted by shawnb — 26 Jul 2016, 06:49


]]>
2016-07-26T06:11:06+02:00 2016-07-26T06:11:06+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35638#p35638 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
To recap : I have an array of singles where each value represents an acsii character. I'm trying to convert this to a string. So I read each value in the array, round()ing it as I go. Now I want to convert each integer value to a char so I can append it to a string. In Pascal proper I'd use the chr() function but in hh that's not available. I guess my question really is how do I convert a single to a char.

Statistics: Posted by ahonoe — 26 Jul 2016, 06:11


]]>
2016-07-25T21:36:16+02:00 2016-07-25T21:36:16+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35635#p35635 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
In case you missed it, there's a very handy page on strings in the scripting language tutorial:
http://www.sensomusic.org/wiki3/doku.ph ... tutorial05

Look at the examples towards the bottom.

Statistics: Posted by shawnb — 25 Jul 2016, 21:36


]]>
2016-07-25T18:39:02+02:00 2016-07-25T18:39:02+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35634#p35634 <![CDATA[What is the hh Pascal equivalent of chr()?]]> ).

Thanks again.

Statistics: Posted by ahonoe — 25 Jul 2016, 18:39


]]>
2016-07-25T14:56:54+02:00 2016-07-25T14:56:54+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35632#p35632 <![CDATA[What is the hh Pascal equivalent of chr()?]]> I'm fact you treat the char as single

Var currentChar: single

...

currentChar := GetdataArrayvalue(input, Idx );

...

SetdataArrayvalue (output, Idx, currentChar) ;

Statistics: Posted by oli_lab — 25 Jul 2016, 14:56


]]>
2016-07-24T22:55:57+02:00 2016-07-24T22:55:57+02:00 https://brainmodular.org/forums/viewtopic.php?t=5479&p=35626#p35626 <![CDATA[What is the hh Pascal equivalent of chr()?]]>
Thanks for your help!

Statistics: Posted by ahonoe — 24 Jul 2016, 22:55


]]>