FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Shift for bits
Shift for bits
Débuté par Marco Rego, 27 aoû. 2008 19:24 - 2 réponses
Connectez-vous…
Marco Rego
#1
Posté le 27 août 2008 - 19:24
Are there any shift left and right related functions for dealing with bits ?
Just found BinaryAND/OR/XOR and it is not exactly what I am looking for.
Signaler
0
0
BLS
#2
Posté le 27 août 2008 - 19:50
Marco Rego schrieb:
Are there any shift left and right related functions for dealing with bits ?
Just found BinaryAND/OR/XOR and it is not exactly what I am looking for.
Hi Marco,
NO, it's a shame but WD has no (or pretty less) support for bit-wise
operations.
However code for shiftleft << and shiftright >> , enjoy.
PROCEDURE ShiftLeft(nInt, nBitsToShift)
nResult is int
WHEN EXCEPTION
ExceptionEnable()
RESULT -1
END
nResult = nInt * Power(2, nBitsToShift)
RESULT nResult
FUNCTION ShiftRight(nInt, nBitsToShift)
nRetval is int
WHEN EXCEPTION
// Capacity Error
ExceptionEnable()
RESULT -1
END
nRetval = nInt / Power(2, nBitsToShift)
RESULT nRetval
PS ..the lack of bit operations in WD is quit annoying. So I wrote all
"low level" code in the D programming language. a DLL then ...
(D is in fact C++ on steroids, without bee'ing too complicated)
http://www.digitalmars.com/d/
HTH Bjoern
Signaler
0
0
Marco Rego
#3
Posté le 28 août 2008 - 01:54
Bjoern, thanx a bunch for your answer and cool code.
Yes, I konow about D, even installed DMD, Tango and Decent in my Ubuntu machine, but later decided that for now WinDev must be my priority. Will go back to it later, want to learn DWT (just wish WinDev have a GUI like GTK in Linux).
Thanks again.
Marco
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte