I am in need of the script to convert from PDU to ASCII. If anyone could
help I would be very gratefull.
TIA,
Cristian Petersen
So you have this format?
http://www.dreamfabric.com/sms/
As a binary blob or a hex string?
As an Hex String. like this:
0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700
"Jeremy Lakeman" <jeremy....@gmail.com> escribi� en el mensaje
news:9f75def8-acc3-4adc...@r31g2000prh.googlegroups.com...
Nasty.
well you can start by converting each character into a numeric value;
string ls_digits='0123456789ABCDEF'
char lca_message[]
long ll_i
integer li_value
for ll_i = lowerbound(lca_message) to upperbound(lca_message)
li_value = pos(ls_digits,lca_message[ll_i]) -1)
...
next
but the rest of what you'll need to do looks nasty.
You might be better off finding / compiling a C or activex object to
do the work for you. Or to translate the algorythm from.
"Jeremy Lakeman" <jeremy....@gmail.com> escribi� en el mensaje
news:c972dae7-3ef7-4912...@z23g2000prd.googlegroups.com...
On Apr 27, 1:59 pm, "Cristian A. Petersen"
<peterse...@petersen.com.py> wrote:
> Jeremy,
>
> As an Hex String. like this:
> 0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700
>
> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribi� en el
li_bit=1
do while li_value>0
if mod(li_value,li_bit*2)>0 then
li_value -= li_bit
...
end if
li_bit *= 2
loop
then you could build a string of '1's and '0's and manipulate the
string.
But still I would recommend a different solution.
On Apr 27, 2:43 pm, "Cristian A. Petersen"
<peterse...@petersen.com.py> wrote:
> thank you Jeremy I already searched trhough the net. Found in Delphi, c##,
> VB but nothing in PB . I already did the first part but then I have bit
> shifting (PB lacks of it)
>
> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribió en el mensajenews:c972dae7-3ef7-4912...@z23g2000prd.googlegroups.com...
> On Apr 27, 1:59 pm, "Cristian A. Petersen"
>
>
>
> <peterse...@petersen.com.py> wrote:
> > Jeremy,
>
> > As an Hex String. like this:
> > 0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700
>
> > "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribió en el
> > mensajenews:9f75def8-acc3-4adc...@r31g2000prh.googlegroups.com...
> > On Apr 27, 11:45 am, "Cristian A. Petersen"
>
> > <peterse...@petersen.com.py> wrote:
> > > Hello,
>
> > > I am in need of the script to convert from PDU to ASCII. If anyone could
> > > help I would be very gratefull.
>
> > > TIA,
> > > Cristian Petersen
>
> > So you have this format?http://www.dreamfabric.com/sms/
>
> > As a binary blob or a hex string?
>
> Nasty.
>
> well you can start by converting each character into a numeric value;
>
> string ls_digits='0123456789ABCDEF'
> char lca_message[]
> long ll_i
> integer li_value
> for ll_i = lowerbound(lca_message) to upperbound(lca_message)
> li_value = pos(ls_digits,lca_message[ll_i]) -1)
> ...
> next
>
> but the rest of what you'll need to do looks nasty.
> You might be better off finding / compiling a C or activex object to
> do the work for you. Or to translate the algorythm from.
>
> eg;http://www.sourcecodeonline.com/details/pduconv_c_functions_for_conve...
For that I also had to do bitshifting.
It worked, but believe me: IT IS SLOW!!!
Powerbuilder is NOT the right tool for this job. Try driving a nail into
wood with a screwdriver. It will work but it's not going to be fast...
Jeremy Lakeman schreef:
> Well you can test each bit like this;
>
> li_bit=1
> do while li_value>0
> if mod(li_value,li_bit*2)>0 then
> li_value -= li_bit
> ...
> end if
> li_bit *= 2
> loop
>
> then you could build a string of '1's and '0's and manipulate the
> string.
>
> But still I would recommend a different solution.
>
> On Apr 27, 2:43 pm, "Cristian A. Petersen"
> <peterse...@petersen.com.py> wrote:
>> thank you Jeremy I already searched trhough the net. Found in Delphi, c##,
>> VB but nothing in PB . I already did the first part but then I have bit
>> shifting (PB lacks of it)
>>
>> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribi� en el mensajenews:c972dae7-3ef7-4912...@z23g2000prd.googlegroups.com...
>> On Apr 27, 1:59 pm, "Cristian A. Petersen"
>>
>>
>>
>> <peterse...@petersen.com.py> wrote:
>>> Jeremy,
>>> As an Hex String. like this:
>>> 0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700
>>> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribi� en el