Val function not recognized (Development Foros MSX)MSX Resource Center MSX Info Update - Finnish MSX madness at its best           
                       
English Nederlands Español Português Russian                  
 Noticias
   Página principal
  Almacén de noticias
  Temas de noticias

 Recursos
   Foros MSX
  Artículos
  Analisis
  Informe de ferias/RUs
  Álbum de fotos
  Ferias y encuentros
  Encuestas
  Enlaces
  Buscar

 Software
   Descargas
  Tienda Online

 MRC
   Quiénes somos
  Únete a nuestro equipo
  Donar
  Políticas
  Contacta con nosotros
  Enlázanos
  Estadísticas

 Buscar
 
  

  

 Login
 

Login

Contraseña




¿Aún no tienes una cuenta? ¡Conviértete en miembro del MSX Resource Center! ¡Únete a nosotros!.


 Estadísticas
 

Hay 157 invitados y 6 miembros en línea

Eres un usuario anónimo.
 

Foros MSX


Foros MSX

Development - Val function not recognized

Autor

Val function not recognized

webmouse
msx lover
Mensajes: 121
Publicado: Mayo 09 2007, 21:27   
Hi all,

I have a small problem with Turbo Pascal 3.3f. Is the Pascal Val function supported?
(to convert a string value to an integer)
The compiler stops with an error msg.



[D-Tail]

msx guru
Mensajes: 2980
Publicado: Mayo 09 2007, 23:24   
Stupid question, being a total (Turbo) Pascal noob, but doesn't it have anything to do with case sensitivity? Maybe val() works?
pitpan
msx master
Mensajes: 1367
Publicado: Mayo 09 2007, 23:56   
Pascal language is case insensitive

About the problem with VAL function, I've never used Turbo-Pascal for MSX
Sd-Snatcher
msx freak
Mensajes: 226
Publicado: Mayo 10 2007, 04:32   
I think you can use it. But is not a FUNCTION, is a PROCEDURE.

VAL                       Convert String to Number                    pp 70

 Syntax:  Val (StrVar,NumVar,Code) ;

 Type:    Integer or Real

 Form:    Procedure

 Purpose: Convert string value of StrVar to a numeric value in NumVar.

 Notes:   NumVar is type Intger or type Real.  Code is any error code.
          No errors occurred if Code = 0.


 ----------------------------------------------------------------------------


 Usage:
       CONST
          StrVar  : String [4] = '1234' ;  { String value of 1234 }
       VAR
          Code    : Integer             ;  { Error code           }
          IntVar  : Integer             ;  { Integer variable     }
          RealVar : Real                ;  { Real variable        }

       BEGIN
          Val ('$FFFE',IntVar, Code)    ;  { '-2'                 }
          Val ('1.123',RealVar,Code)    ;  { '1.1230000000E+00'   }
          Val (StrVar, IntVar, Code)    ;  { '1234'               }
       END.

webmouse
msx lover
Mensajes: 121
Publicado: Mayo 10 2007, 08:08   
Thanx! that was the problem. I used it as a function ... works now .
 
 







(c) 1994 - 2008 Fundación MSX Resource Center. MSX es una marca registrada de MSX Licensing Corporation