Código ASCII


ascii

ASCII (acrónimo inglés de American Standard Code for Information Interchange — Código Estándar Estadounidense para el Intercambio de Información), pronunciado generalmente [áski] o [ásci] , es un código de caracteres basado en el alfabeto latino, tal como se usa en inglés moderno. Fue creado en 1963 por el Comité Estadounidense de Estándares (ASA, conocido desde 1969 como el Instituto Estadounidense de Estándares Nacionales, o ANSI) como una refundición o evolución de los conjuntos de códigos utilizados entonces en telegrafía. Más tarde, en 1967, se incluyeron las minúsculas, y se redefinieron algunos códigos de control para formar el código conocido como US-ASCII.

El código ASCII utiliza 7 bits para representar los caracteres, aunque inicialmente empleaba un bit adicional (bit de paridad) que se usaba para detectar errores en la transmisión. A menudo se llama incorrectamente ASCII a otros códigos de caracteres de 8 bits, como el estándar ISO-8859-1, que es una extensión que utiliza 8 bits para proporcionar caracteres adicionales usados en idiomas distintos al inglés, como el español.

ASCII fue publicado como estándar por primera vez en 1967 y fue actualizado por última vez en 1986. En la actualidad define códigos para 32 caracteres no imprimibles, de los cuales la mayoría son caracteres de control que tienen efecto sobre cómo se procesa el texto, más otros 95 caracteres imprimibles que les siguen en la numeración (empezando por el carácter espacio).

Casi todos los sistemas informáticos actuales utilizan el código ASCII o una extensión compatible para representar textos y para el control de dispositivos que manejan texto como el teclado. No deben confundirse los códigos ALT+número de teclado con los códigos ASCII.

MS Small Basic: overview of stack and matrix (code of Flight Reservation program)


reservavuelos

Of the Tutorial Small Basic Curriculum (3.2) , we take that :
An array (Array) can be multidimensional, but a stack (Stack object) has only one dimension. You can directly access any element of an array, but can only access the top element of the stack. That is, if you want to access the last element of the stack, you have to go through all the elements from the beginning.
An array is a variable type that can store multiple values ​​at once. If you want to store the names of five users, rather than to create 5 variables, you can use only one variable to store the five names
And remember that in Small Basic the Stack object  is used to store data as if it will stack plates. This object follows the principle: first in, first out

Let’s use the Array object, to write a program «Flight Reservation» (excellent example) that executes the following steps:

Reserve seating for 10 passengers.
 Display the name of each passenger and seat number
 Display the total number of seats available.
code:

  1. TextWindow.WriteLine(«Reservas de vuelos»)
  2. TotalAsientos = 10
  3. For i = 1 To TotalAsientos
  4.   TextWindow.Write(«Introduzca el nombre del pasajero: «)
  5.   nombre[i] = TextWindow.Read() 
  6.   TextWindow.WriteLine(«El número de asiento » + i + » está reservado para » + nombre[i])
  7.   ObtenerDetalles()
  8. EndFor
  9.  
  10. Sub ObtenerDetalles
  11.   If Array.GetItemCount(nombre) = TotalAsientos Then
  12.     TextWindow.WriteLine(«¡No hay más asientos disponibles!»)
  13.   Else
  14.     Array.GetItemCount(nombre)
  15.     AsientosDisponibles = TotalAsientos – Array.GetItemCount(nombre)   
  16.     TextWindow.WriteLine(«Número de asientos disponibles: «+ AsientosDisponibles)
  17.     TextWindow.WriteLine(«»)   
  18.   EndIf
  19. EndSub

MS Small Basic: files and directories (code)


file3

To learn programming, you must program, program and program.
I took several short exercises of the Curriculum and wrote these into a single program.
This exercise includes objects: ImageList; Network and File
Chapters 2.6 and 3.1 of the Curriculum Tutorial

  1. GraphicsWindow.Title = «Imagen»
  2. rutaImagen = «C:\Users\carlos\Pictures\conchilas.jpg»
  3. Imagen = ImageList.LoadImage(rutaImagen)
  4. GraphicsWindow.Width=ImageList.GetWidthOfImage(rutaImagen)
  5. GraphicsWindow.Height=ImageList.GetHeightOfImage(rutaImagen)
  6. GraphicsWindow.DrawImage(Imagen, 0, 0)
  7. ‘ Fin
  8.  
  9. rutaarchivo1= «http://download.microsoft.com/download/9/0/6/90616372-C4BF-4628-BC82-BD709635220D/Introducing%20Small%20Basic.pdf»
  10. ArchivoDescargado= Network.DownloadFile(rutaarchivo1)
  11. TextWindow.WriteLine(» Archivo descargado:   » + ArchivoDescargado)
  12. ‘ Fin
  13.  
  14. rutaarchivo2= «http://download.microsoft.com/»
  15. ContenidoPaginaWeb = Network.GetWebPageContents(rutaarchivo2)
  16. TextWindow.WriteLine(«Contenido de la pagina:  «)
  17. TextWindow.WriteLine(ContenidoPaginaWeb)
  18. ‘ Fin
  19.  
  20. TextWindow.WriteLine(» El objeto File  «)
  21. rutaarchivo3= «c:\Users\carlos\temp\SubdirectorioTemp\mio.txt»
  22. TextWindow.WriteLine(«Escribir Contenido» + File.WriteLine(rutaarchivo3, 1, «Boca es un gran equipo de futbol»))
  23. TextWindow.WriteLine(«Agregar contenido» + File.AppendContents(rutaarchivo3, » y ademas gano muchos trofeos»))
  24. TextWindow.WriteLine(«Leer contenido=  » + File.ReadContents(rutaarchivo3))
  25. ‘ Fin
  26.  
  27. As Nonki says, to learn programming, program and program.
    I took several short exercises of the Curriculum and wrote these into a single program.
    This exercise includes objects: ImageList; Network
    and File
    Chapters 2.6 and 3.1 of the Curriculum
    Keep in mind that the paths of the files and directories must be such as we have in our physician C:
    Perhaps someone more novice than me, this will serve.
    regards
  28.  
  29.  
  30. rutaArchivoOrigen = «c:\Users\carlos\temp\SubdirectorioTemp\mio.txt»
  31. rutaArchivoDestino = «C:\Users\carlos\temp\SubdirectorioTemp\mover.txt»
  32. rutaDirectorio= «C:\Users\carlos\temp\SubdirectorioTemp»
  33. TextWindow.WriteLine(«Copiar archivo de operacion: » +File.CopyFile(rutaArchivoOrigen,rutaArchivoDestino))
  34. TextWindow.WriteLine(» Archivos en el directorio:  » + File.GetFiles(rutaDirectorio))
  35. ‘ Fin
  36.  
  37. rutaDirectorio1 = «C:\Users\carlos\temp\Small Basic»
  38. TextWindow.WriteLine(«Crear directorio:  » + File.CreateDirectory(rutaDirectorio1))
  39. rutaDirectorio2 = «C:\Users\carlos\temp»
  40. TextWindow.WriteLine(«Directorios:  «+ File.GetDirectories(rutaDirectorio2))
  41. ‘ Fin
  42. TextWindow.WriteLine(» Ultimo error «)
  43. rutaarchivo4 = «c:\Users\carlos\temp\SubdirectorioTemp\mio.txt»
  44. TextWindow.WriteLine(» Operacion WriteLine: » + File.WriteLine(rutaarchivo4, 1, » como esta ? «))
  45. If File.LastError = » » Then
  46.   TextWindow.WriteLine(«La operacion se completo con exito»)
  47. Else
  48.   TextWindow.WriteLine(File.LastError)
  49. EndIf
  50. ‘Fin