Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 5 Jahren, 2 Monaten
Letzter Beitrag:
vor 5 Jahren, 2 Monaten
Beteiligte Autoren:
ER_T, Steven Sitas, Alexandre Leclerc, Paulo Oliveira, Al

Binary combinations (starter)

Startbeitrag von ER_T am 08.05.2013 20:16

I want to try to write a smal prg with windev. 2 edit fields 1 numeric 1 text and a buttun

I wanne try to write a prg that finds out all possibel bninary combinations
the length shoot be defined in edit numeric field.and the output in text

for exampel if the length is 3 then in the text field it shoot say
000
001
010
100
101
100
110
011
111
i want to try to do that with verry long lenghts the 3 was just a exampel
I am new with windev this is my first complicated project.So i am wondering can
someone puth me in the wright direction since i dont have a clue how to start.

Thanks in advance
for evryone that posts a reply

Antworten:

Hello ER_T

Why do you need to do this and what is the purpose of the program ?

Windev is such an idiosynchractic language that the best solutions come from an understanding of why and what in relation to any problem.

Regards
Al

von Al - am 08.05.2013 22:40
wel i wanne try somthing out of the box.Iwant to try to build my own special form of database/compression in the long run.Buth there for i need to build a small program that can find out al possibel binary combinations of a curtain lengt (later i wanne implent in the compleat prg).

von ER_T - am 08.05.2013 23:41
I'm not sure what you need for your result.You need it in decimal values/hexadecimal...?
Try to start digging the ASC, CHARACT and VAL functions
If it's in hexadecimal NUMTOSTRING is your friend.

You can always do it byte by byte and in that case you know that it's between 0 and 255 (00 -FF) but it should take some time for very long string.

If you need to go deeper it's possible to do it at the bit level, check Binary operators in the help.

For this purpose the buffer type variable should be your best friend, check it in the help.

von Paulo Oliveira - am 09.05.2013 08:44
ASC = writes to buffer (dont need that)
Charact = returns a certain character from a string (dont need that)
Val returns= retairns u certain value of a string

Non of these comands have anything to do with creating a certain lengt (25)(of binary code)
1010001000000111100000000(25)
and find out all possibel combinations (also somtimes refured to as Permutations)

von ER_T - am 09.05.2013 14:03
Hi ER_T,

Take a look at the help for "binary": http://doc.pcsoft.fr/en-US/?1512009

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 09.05.2013 14:55
If you are looking how to code fore permutations, take a look here:
http://rosettacode.org/wiki/Permutations

Steven Sitas

von Steven Sitas - am 09.05.2013 18:35
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.