Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function: Separate the integer part of the fractional part without rounding.
#1
FUNCTION enterdec$ (v$, x$)
'Function: Separate the integer part of the fractional part without rounding.
'The X$ must be: E = integer <> D = decimal

'Funcion: Separa la parte entera de la parte decimal sin redondeos
'La x$ tiene que ser: E = entero <>  D = decimal

x$ = UCASE$(x$)
FOR n = 1 TO LEN(v$)
z$ = MID$(v$, n, 1)
IF z$ = "." THEN w = 1
IF w = 0 THEN ent$ = ent$ + z$: lent = lent + 1
IF w = 1 THEN dec$ = dec$ + z$: ldec = ldec + 1
NEXT n
IF x$ = "E" THEN enterdec$ = ent$
IF x$ = "D" THEN enterdec$ = dec$
END FUNCTION
Reply
#2
You can use the INT function
or
A=B\C
MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Reply
#3
Hi, Opresion:

Very Thanks!

Greeting from Spain
Reply
#4
(08-19-2008, 12:36 PM)lrcvs link Wrote:Hi, Opresion:
Very Thanks!
Greeting from Spain

Greetings from Mexico.
MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Reply
#5
Es bueno saber que hay mas hispanos / latinos que nos gusta Qbasic.

Ya empezaba a preocuparme, si era el unico hispano / latino que le gustase Qbasic.!

En este foro y en Bsic he encontrado muy buenos amigos.

Saludos desde España

.................................................

It's good to know that there are more Hispanis / Latins we like QBasic.

It was beginning to worry about, whether it was the only Hispanis / Latin who likes QBasic.!

In this forum, and BAsic I found very good friends.

Greetings from Spain






Reply
#6
http://www.lawebdelprogramador.com/news/...exto=Basic
http://www.lawebdelprogramador.com/news/...QuickBasic
MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Reply
#7
Hello Opresion:

I know that page.

Also I saw your name on several consultations and the pages indicating that know them well.

However, I do not understand really want to say in that post on separate the integer part of the decimal.

Greetins from Spain
Reply
#8
(08-20-2008, 02:20 PM)lrcvs link Wrote:...I do not understand really want to say in that post on separate the integer part of the decimal.

There is no relation, it's just info.
MY QBASIC'S PAGE                                                  I ONLY USE WINDOWS 98SE
Reply
#9
Ok.

Vale!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)