Toon posts:

[VB/Perl]String conversie in VB omzetten naar Perl

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik moet een waarde uit een xml file omzetten, als voorbeeld heb ik een stukje VB code. Er is alleen een stukje dat ik niet snap.

code:
1
2
3
4
5
6
7
8
dim s as string
s = "FDEFC12ABD"
dim f ' where f is opened as a binary file for writing
for i = 1 to len(s) step 2
hexnum = mid( s, i, 2)
intnum = CInt( "&H" & s )
print f, intnum
next


Wat doet regel 6?

  • mulder
  • Registratie: Augustus 2001
  • Laatst online: 24-05 21:13

mulder

ik spuug op het trottoir

Cast de hex waarde naar een integer

oogjes open, snaveltjes dicht


  • muba
  • Registratie: April 2002
  • Laatst online: 19-10-2013

muba

Prince of Persia!

Maar... wat heeft dat nou met Perl te maken?

Reporter: Mister Gandhi, what do you think of western civilisation?
Gandhi: I think it would be a good idea


  • TeeDee
  • Registratie: Februari 2001
  • Laatst online: 14:05

TeeDee

CQB 241

Zal wel asp:Apache zijn.

Heart..pumps blood.Has nothing to do with emotion! Bored


Verwijderd

Topicstarter
Als ik niet weet wat VB intnum = CInt( "&H" & s ) is, hoe kan ik het dan naar Perl vertalen.

  • BOOTZ
  • Registratie: Maart 2001
  • Laatst online: 17-03 09:38
volgens mij kan dat in perl gewoon met $var = int(0x$hexvalue), maar weet het niet helemaal meer zeker (lang geleden :X)

Maak je eigen poll

Pagina: 1