sábado, 26 de septiembre de 2015

73 Comandos Basicos para postgres



1. Crear un Usuario.
[postgres@GNU][~]$ createuser luix
Clase_Maritima=> CREATE USER pilar with password ‘pilar’;
2. Listando todos los usuarios
Clase_Maritima=> du
Clase_Maritima=> SELECT * FROM pg_user ;

3. Cambiando el Password de un Usuario.
Clase_Maritima=> ALTER USER pilar with password ‘123456’;

4. Cambiando el nombre de un usuario
Clase_Maritima=> ALTER USER pilar RENAME TO manolo;

5. Borrando Usuarios

[postgres@GNU][~]$ dropuser pilar

Clase_Maritima=>drop user pilar;

6. Crear una Base Datos
[postgres@GNU][~]$ createdb Maritima
Clase_Maritima=> CREATE DATABASE marimar;

7. Listando todas las Base Datos
Clase_Maritima=> l
Clase_Maritima=> SELECT datname FROM pg_database ;
[postgres@GNU][~/data]$ psql -l

8. Cambiando el nombre de una Base datos
Clase_Maritima=> ALTER DATABASE marimar RENAME TO Maritmar;

9. Borrando una Base Datos
postgres@GNU][~]$ dropdatadb Maritima
Clase_Maritima=>drop database Maritima;

10. Accesando a una Base Datos con un usuario.
[postgres@GNU][~]$ psql -U pilar -h localhost -d Maritima

11. Creando Tablas
CREATE TABLE Pollo (
Codigo char(5),
Nombre varchar(40),
Peso integer ,
Edad date,
Famila varchar(10)
);

12. Creando tabla desde un SELECT
Clase_Maritima=> create table Mar as SELECT * FROM pollo;

13. Listando las Tablas creadas
Clase_Maritima=>dt
Clase_Maritima=> SELECT * FROM pg_tables;

14. Viendo la Estructura de una Tabla
Clase_Maritima=>d pollo

15. Cambiando el nombre de una Tabla
Clase_Maritima=> ALTER TABLE pollo RENAME TO pollos;

16. Cambiando el nombre de un campo de una Tabla
Clase_Maritima=> ALTER TABLE pollos RENAME edad TO Fecha_Muerte;

17. Agregandole un campo a una tabla
Clase_Maritima=> ALTER TABLE pollos ADD column sex char(1);

18. Borrando un campo de una tabla
Clase_Maritima=> ALTER TABLE pollos DROP sex;

19. Cambiando el tipo de dato de una columna de una tabla.
Clase_Maritima=> ALTER TABLE pollos ALTER codigo TYPE varchar;

20. Borrando una Tabla
Clase_Maritima-> DROP TABLE pollo;

21. Insertando Datos en una Tabla
Clase_Maritima=> INSERT INTO pollo VALUES ( ‘1’, ‘Gallina’, 8, Current_date, ‘Criollo’);

22. Insertando datos a partir de un SELECT
Clase_Maritima=> INSERT INTO pollos (nombre, famila) SELECT bandera, codigo FROM buque ;

23. Selecionado datos de una tabla
Clase_Maritima=> SELECT * FROM pollo ;

24. Muestra el plan de ejecución de la sentencia
Clase_Maritima=# EXPLAIN SELECT * FROM buque ;

25. Para saber la cantidad de registro en una tabla (Count)
Clase_Maritima=# SELECT count(*) FROM buque ;

26. Selecionar los registros no repetidos de una campo (DISTINCT)
Clase_Maritima=# SELECT distinct(bandera) FROM buque ;

27. Actualizando datos de una tabla
Clase_Maritima=> UPDATE pollo SET nombre = ‘Gallo’ WHERE codigo=1;

28. Borrando registros de una tabla.
Clase_Maritima=> DELETE FROM pollo WHERE codigo =’1′;

29. Truncando tablas
Clase_Maritima=> TRUNCATE pollo ;

30. Agregando una llave primaria a un campo de una tabla
Clase_Maritima=> ALTER TABLE pollos ADD CONSTRAINT pk_codigo PRIMARY KEY (codigo);

31. Creando una Vista
Clase_Maritima=# CREATE VIEW v_pollo as SELECT * FROM pollos ;

32. Seleccionando datos de una Vista
Clase_Maritima=# SELECT * FROM v_pollo ;

33. Viendo las Vistas Creadas
Clase_Maritima=#dv
Clase_Maritima=# SELECT viewname FROM pg_views ;

34. Borrando una Vista
Clase_Maritima=# DROP VIEW v_pollo ;

35. Agreando una llave foraneas a un campo de una tabla
Clase_Maritima=> ALTER TABLE pollos ADD CONSTRAINT pk_codigo FOREIGN KEY (codigo) REFERENCES buque (codigo);

36. Borrando una un CONSTRAINT
Clase_Maritima=> ALTER TABLE pollos DROP CONSTRAINT pk_codigo;

37. Agregando un CONSTRAINT CHECK a un campo
Clase_Maritima=> ALTER TABLE pollos ADD CONSTRAINT c_check check (fecha_muerte > ‘2007-01-01’);

38. Agregando un CONSTRAINT DEFAULT a un campo
Clase_Maritima=> ALTER TABLE pollos ALTER peso SET DEFAULT 23;

39. Creando un índice a una tabla
Clase_Maritima=> CREATE INDEX pkU_pollo ON pollos (codigo);

40. Creando un indice unico
Clase_Maritima=> CREATE UNIQUE INDEX pku_pollo ON pollos (peso );

41. Cambiandole el nombre a un indice
Clase_Maritima=> ALTER INDEX pku_pollo RENAME TO pki_pollo;

42. Ver los indices creados en una Base Datos
Clase_Maritima=>di
Clase_Maritima=> SELECT indexname, tablename FROM pg_indexes;

43. Borrando un indice
Clase_Maritima=> DROP INDEX pku_pollo ;

44. Creando un sequence
Clase_Maritima=> CREATE SEQUENCE s_mari start with 1000 increment by 2 maxvalue 1100;

45. Ver el siguente valor de un sequence
Clase_Maritima=> SELECT nextval(‘s_mari’);

46. Ver el valor actual de un sequence
Clase_Maritima=> SELECT currval(‘s_mari’);

47. Modificar el valor inicial de un sequence
Clase_Maritima=> SELECT setval(‘s_mari’, 1000);

48. Utilizando INNER JOIN
Clase_Maritima=# SELECT * FROM files f Inner Join lineas l ON l.codigo=f.linea;

49. Utilizando LEFT OUTER JOIN
Clase_Maritima=# SELECT * FROM files f LEFT OUTER JOIN lineas l ON l.codigo=f.linea;

50. Utilizando RIGHT OUTER JOIN
Clase_Maritima=# SELECT * FROM files f RIGHT OUTER JOIN lineas l ON l.codigo=f.linea;

51. Utilizando FULL OUTER JOIN
Clase_Maritima=# SELECT * FROM files f FULL OUTER JOIN lineas l ON l.codigo=f.linea;

52. Utilizando LEFT OUTER JOIN
Clase_Maritima=# SELECT * FROM files f LEFT Join lineas l USING(Linea);

53. Utilizando operador Mayor que
Clase_Maritima=# SELECT buque, loa FROM buque WHERE loa > 1000;

54. Utilizando operador Menor que
Clase_Maritima=# SELECT buque, loa FROM buque WHERE loa < 1000;

55. Utilizando operador Igual
Clase_Maritima=# SELECT buque, loa FROM buque WHERE buque=’AIDA’;

56. Utilizando operador Menor o igual que
Clase_Maritima=# SELECT buque, loa FROM buque WHERE loa <= 1000;

57. Utilizando operador Mayor o igual que
Clase_Maritima=# SELECT buque, loa FROM buque WHERE loa >= 1000;

58. Utilizando operador No igual
Clase_Maritima=# SELECT buque, loa FROM buque WHERE loa <> 1000;

Clase_Maritima=# SELECT buque, loa FROM buque WHERE loa != 1000;

59. Utilizando operador Concatenación
Clase_Maritima=# SELECT buque||’ ‘ ||dueno FROM buque ;

60. Utilizando EXISTS
SELECT * FROM boardingclerk WHERE exists(SELECT 1 FROM files);

61. Utilizando conector IN
SELECT * FROM files WHERE boarding_clerk IN (31, 33, 35);
SELECT * FROM files WHERE boarding_clerk NOT IN (31, 33, 35);

62. La cláusula ORDER BY
Clase_Maritima=# SELECT * FROM puertos ORDER BY 1 ASC;
Clase_Maritima=# SELECT codigo, puerto FROM puertos ORDER BY puerto DESC;

63. La cláusula GROUP BY
Clase_Maritima=# SELECT buque, count(*) FROM files GROUP BY buque;

64. Funciones para calcular
Clase_Maritima=# SELECT AVG(LOA) FROM BUQUE;
Clase_Maritima=# SELECT MAX(LOA) FROM BUQUE;
Clase_Maritima=# SELECT MIN(LOA) FROM BUQUE;
Clase_Maritima=# SELECT SUM(LOA) FROM BUQUE;

65. Operaciones de conjunto (UNION).
SELECT linea FROM files
union
SELECT codigo FROM lineas ;

66. Operaciones de conjunto (UNION ALL).
SELECT linea FROM files
union all
SELECT codigo FROM lineas ;

67. Operaciones de conjunto (INTERSECT).
SELECT linea FROM files
INTERSECT
SELECT codigo FROM lineas ;

68. Utilizando operadores aritméticos
FCLD=# SELECT 8+3 as Suma;
FCLD=# SELECT 8-3 as Resta;
FCLD=# SELECT 8/3 as Divide;
FCLD=# SELECT 8*3 as Multiplica;

69. Utilizando Funciones Matemáticas
FCLD=# SELECT 20-233 as Resta ; — El resultado Sera Negativo
FCLD=# SELECT abs(20-233) as Resta ; Esta Funcion
FCLD=# SELECT cbrt(27); — Retorna El cubo
FCLD=# SELECT round(99.4);
FCLD=# SELECT round(99.2, 3);
FCLD=# SELECT pi();
FCLD=# SELECT trunc(99.1);

70. Funciones Cadenas
FCLD=# SELECT ‘Jose’||’Paredes’;
FCLD=# SELECT bit_length(‘k’) ;
FCLD=# SELECT char_length(‘jose’);
FCLD=# SELECT lower(‘GNU’);
FCLD=# SELECT upper(‘gnu’);
FCLD=# SELECT initcap(‘manuel’);
FCLD=# SELECT ascii(‘K’);
FCLD=# SELECT chr(75);
FCLD=# SELECT md5(‘1’);

71. Funciones Fechas y Horas
FCLD=# SELECT abstime(‘now’::timestamp); –convierte a abstime
FCLD=# SELECT age(‘now’,’1957-06-13′::timestamp); –preserva meses y años
FCLD=# SELECT to_char(current_timestamp,’HH12:MI:SS’); –convierte datetime a string
FCLD=# SELECT to_char( now(), ‘HH12:MI:SS’);
FCLD=# SELECT current_date;
FCLD=# SELECT current_timestamp;
Clase_Maritima=# SELECT to_date(fecha_llegada, ‘Mon MM YY’) FROM files ;
Clase_Maritima=# SELECT to_char(to_date(fecha_llegada, ‘Mon MM YY’), ‘YYYY-Month-Day’) FROM files ;
FCLD=# SELECT to_date(’08 Dec 2007 13′, ‘DD Mon YYYY HH’); –convierte string a date

72. Los conectores lógicos en SQL son AND-OR- NOT
Clase_Maritima=# SELECT buque, capitan, bandera, loa FROM buque WHERE capitan like ‘A%’ AND loa <1000 OR loa=2450;

73. Copiando datos desde un archivo a una tabla
COPY buque FROM ‘/var/lib/pgsql/Buquedatos.txt’;

lunes, 21 de septiembre de 2015

Mi clase java Postgres

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package abbir;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Administrador
 */
public class Postgres {
//DATOS PARA LA CONEXION

    private final String database = "abbir";
    private final String hostname = "localhost";
    private final String port = "5432";
    private final String user = "postgres";
    private final String password = "1234";
    private final String gestor = "postgresql";
    private final String url = "jdbc:" + gestor + "://" + hostname + ":" + port + "/" + database;
    private Connection conectar = null;

    //Constructor de clase que se conecta a la base de datoS
    public Connection Postgres() {
        try {
            Class.forName("org.postgresql.Driver");
            conectar = DriverManager.getConnection(url, user, password);
            System.out.println("Conectado a la base de datos [ " + this.database + " " + this.gestor + "]");
        } catch (ClassNotFoundException | SQLException e) {
            System.err.println(e.getMessage());
        }
        return conectar;
    }

    Connection getConnection() {
        return conectar;
    }

    void desconectar() {
        conectar = null;
        System.out.println("La conexion a la  base de datos " + database + " a terminado");
    }
}

domingo, 20 de septiembre de 2015

3 juegos que te harán pensar

3 juegos que te harán pensar

JAN29
Google Play cuenta con miles de juegos entretenidos unos gratuitos otros de pagos, a continuación te presento tres divertidos juegos para pasar el rato, todas con versiones gratuitas.
2048 Number Puzzle game
Descripción
2048 es un juego en línea y para móviles creado en marzo de 2014 por el desarrollador web italiano de 19 años Gabriele Cirulli, cuyo objetivo es deslizar baldosas en una cuadrícula para combinarlas y crear una baldosa con el número 2048. Cuando se crea un mosaico de 2048, el jugador gana.
Cirulli creó el juego durante un fin de semana como prueba para determinar si era capaz de programar un juego desde cero, describiéndolo como un clon de la aplicación 1024 de Veewo Studios, tomando la idea de ampliarlo a 2048 basado en el clon 2048 de Sami "Saming" Romdhana, quedando sorprendido cuando el juego tuvo más de 4 millones de visitas en menos de una semana, especialmente debido a que era un proyecto de fin de semana.0 Cirulli, en una entrevista, declaró que "fue una manera de hacer pasar el tiempo".
Descargar

Logic Maze
Logic Maze es un juego de puzzle para poner a prueba el razonamiento lógico y el coeficiente intelectual. El objetivo es simple: para resolver el nivel en el que sólo hay que llegar a la estrella. Para lograr esto se puede empujar y rotar los bloques, la definición de una estrategia.
Ponga a prueba su razonamiento lógico!
DESCARGAR

Lightbot One Hour Coding

Enseña programación a los niños de la manera más divertida.
Lightbot One Hour Coding está destinado a introducir a los niños que no tienen experiencia alguna programación, y es para todas las edades también. pueden jugar, divertirse y aprender la lógica de programación real.
Lightbot One Hour Coding es un juego puzzle de programación: un juego de puzzle que utiliza la mecánica de juego que están firmemente arraigados en los conceptos de programación. permite a los jugadores ganan una comprensión práctica de los conceptos de control de flujo básicos como la secuenciación de instrucciones, procedimientos y bucles, con sólo guiar a un robot con comandos para iluminar azulejos y resolver los niveles.
DESCARGAR

"Un programador es un mamifero nocturno de ojos rojos capaz de conversar con objetos inanimados"

"Un programador es un mamifero nocturno de ojos rojos capaz de conversar con objetos inanimados"

jueves, 17 de septiembre de 2015

la señal wifi con unas latas

Cómo mejorar la señal wifi con unas latas



Pueden ser latas de cerveza como pueden serlo de cualquier refresco,Como sea, para el caso que nos ocupa lo importante es que la disponibilidad, la forma y el aluminio en el que están fabricadas las latas permiten mejorar la señal wifi de forma económica, rápida y fácil.
El resultado es un poco de aquella manera —entre lo cutre y lo agresivo para la vista y también para el total del cuerpo humano—, pero ahí queda la idea:



cortar las latas como se muestra en la foto sin cortarse ningún dedo y colocarlas en las antenas del router para «dirigir» la señal wifi allí donde resulta más necesaria o donde llega titubeante. Por supuesto, es necesario que el router tenga antenas.
Según se puede leer en Can You Really Boost your Wifi Router Signal with a Beer Can? la respuesta a la pregunta es que sí, funciona. O al menos eso parece a juzgar por los resultados de las mediciones tomadas antes y después de convertir el router en un adefesio.

Trucos Fivewin

This comes to story for the old probervio:
-If your you have suffered for your ignorance, he/she teaches to the other ones that they don't suffer that that your, and this way you anger reducing the suffering in the world (of T.A.O.)

It is a summary of the questions and answers made to the list "fivewin-the"
during the four first months of fivewin sufridor

I have not been about making anything beautiful, but useful that occupies not very for that reason he/she goes in pure text

It is chaotic, anarchical, disordered, but if alone to one of you avoids him/her the suffering, I give for very employee the time that I have used in gathering it

if somebody the improvement, charmed, if the raisin to other, also, alone I ask that you don't erase the final part of the text that less, not?????

and beginning that it is gerund .....

1.-When we want to make that the messages of a button of an I dialogue they appear in the bar of messages of the main window..

this it is OWND; to put in the I dialogue the instructions

it defines dialog odlg. .... of ownd

acti dialog .... CENTERED  

2.-  as filtering a listbox of a database, for those records that complete a certain condition.


oLBX:SetFilter ("CAMPO_o_EXPRESION", "Valor_TOPE_del_FILTRO", "Valor_ULTIMO_del_FILTRO")
oLBX:GoTop()


3.-DLL doesn't close when there is an abnormal termination of the Program.
For that it uses:

WPS.exe

It is an utility to close DLL that are open.
or it places in your program the instruction CLIPPER

Exit Final Procedure / / this it is of clipper that you know it
   //Sep Resources / / it Liberates all the Loaded Resources
   FreeResources () / / Also but with Function (it is the same but more beautiful)
freelibrary ('miBWCC.DLL')
    //oFont:End()
Return

4.-They leave strange things when giving to the button dcho in a get... with regard to the menu popup if you can modify it, but you have to alter the class TGet.
Then you should modify the Class TGET.
Among you line them 954 and 1041 (approximately) of TGET.prg, this the method ButtonDown.
I believe that it can work putting an asterisk to it lines her 1039 (or to it lines her that he/she says:

ACTIVATE YOU POPUP oMenu AT nRow - 60, nCol OF Self

 
5.-To incrust a bmp in an I dialogue with WS
 
Do you already have BMP that "build" the button of the magnifying glass?
   What you have to make is to open Workshop 2 times, one with your DLL and another with my DLL. It copies the bellboys of my dll, and hit them in your dll, to change the bmp of the alone button you should change their you GO.
 
- He/she remembers to make SEP RESOURCES TO "MIDLL.DLL"
and hBorland:=LoadLibrary ("BWCC.DLL"), at the beginning of MAIN ().

 If your Button has the you GO 445, then him but insurance is that inside your DLL there is 2 BMP that finish in 445 at least (those they are BMP that build to the button and that they give him/her the appearances of: Normal button, pressed Button and Button with Focus). BMP will have (so that Borland works as Bellboys), to be: 1445 (bmp of the normal button), 3445 (bmp of the pressed button), and 5445 (bmp of the button with focus).
If you want to change the size of the button, you will change the size to these 3 Bmp's. (I use the bellboys a lot Borland but single use those that begin with 1 and with 3, that is to say that when my bellboys have the focus, they are come with Bmp that begins with 1 and not with 5). That is to say: It is not obligatory to use the bmp that begins with 5.
   
6.-Error when recording Dll.
 
It doesn't allow me to record .dll he/she tells me

Unexpected file format

That can fix it Recording your resources above another existent (clear, sacks a copy of a dll of another program) DLL, and later you make a rename to that DLL and you follow it using with WS.

7.- Technique of the magnifying glass

 Objective:
1) if the user enters a code been worth, then the focus should not stop in the button of the magnifying glass.
2) if the user doesn't enter any code (content inside the chart DBF), then the button of the magnifying glass if he should acquire the focus.
3) if the user enters a missed code, (that is to say: that it is not contained inside DBF), then the button of the magnifying glass IF it should win the focus.
4) the button of the magnifying glass, it should activate other I dialogue where spreads a browse of help with the data of DBF that it contains the codes in question.



8.-To make that the icon appears in .exe; to see the icon from the explorer

You have to record an icon like file .RC, and to "incrust it" then in your exe that Blinker takes place it.
The incrustador of the icon inside the exe is RC.EXE (and BRC.EXE if you use that of the workshop).
The icon .RC generates it in the workshop.
If you incrust all your complete resources in the exe, (if you make this it is because you don't want to use DLL in time of execution), then the icon of the exe will be the first icon of the group ICON inside the resources  


9.- a problem of VmPreAlloc.
       I have the solution for your friend, tell him/her that it compiles the object that I annex you next to their other obj and resolved problem.
the obj is ALLOC.obj. ....


10.-Fonts handling
You have to change Font in your program.

LOCAL BACEPTA, OBMP, OFONT, OSAY2, OFONT2
DEPRIVE YOU OTIMER, ODLG, OSAY
FONT DEFINES OFONT YAM "MS SANS SERIF" SIZE 0, -10
FONT DEFINES OFONT2 YAM "ARIAL" SIZE 0, -20 BOLD
DIALOG DEFINES ODLG TITLE 'Transfer of NOTES OF OFFICE .....' RESOURCE 'DLG_001' FONT OFONT
BITMAP REDEFINES OBMP you GO 102 OF ODLG RESOURCE 'DMICH'
OBMP:CENTER()
SAY REDEFINES OSAY you GO 120 OF ODLG COLOR CLR_BLUE FONT OFONT2
BUTTON REDEFINES BINFO You Go 442 OF ODLG ACTION He/she Informs (M - > Author, 'Software Development')
BUTTON REDEFINES BACEPTA you GO 400 OF ODLG ACTION (ODLG:END())
OSAY:SETTEXT ('Waiting .............')
ACTIVATE YOU DIALOG ODLG CENTER ON INIT DEFINIT (ODLG)
REREAD YOU TIMER OTIMER
RETURN NIL


11.- I fail in the evaluation pile:
SOLVED

> Which the values of Heapsize and Stacksize were?
> (The Previous Ones and the New Ones) ...................
>
    stacksize of before.- 9500
    heapsize of before.- 4096

    stacksize of now.- 9500
    heapsize of now.- 8192

    Greetings.

12.-I manage of the database
The problem was in that toward a dbSelectArea ("CLIE") after making a
DATABASE oDclien and as it seems it is necessary to make it, I thought that once
open the charts you could create the object chart and later to select the
chart, but it seems to be that it is not this way. Curious truth?

13.- now I cannot load but of a DLL, it doesn't recognize me the resources of the
 second that I load.

The first time that you call to SEP RESOURCES TO... you establish DLLs
that you will use for the resources. Starting from there, you must return to
to call to SEP RESOURCES TO to select the one that you will use in each
moment:

   SEP RESOURCES TO "system\comun.dll", "system\part.dll"

now, if you will consent to resources that are in part.dll:

   SEP RESOURCES TO "system\part.dll"

Lastly, if you call to SEP RESOURCES TO without more parameters
then discharges all the DLLs of the memory.


14.-Problems with the dll without open WS
> Simple solution.
>
> When you will keep DLL you enter in the Option:
>
> Save file ace
>
> And the guards on a dll (anyone) that already exists.
> (Of course, you work on a copy).


That has already proven it and he/she tells me the same thing; unexpectec....
It recorded it on screen.dll

Good P. d.; I have copied one of those that work well!!!FOS.DLL has changed It name, and I have told him/her save ace, and WELL

IT WORKS..

AND I CHANGE HIM/HER THE SEP RESOURCES TO "FOS.DLL"

AND IT IS NO LONGER NECESSARY TO LOAD WS...



15.-Spinners
 This is a SPINNER:



It is a Get with Vertical Scroll Bar, and in the one it REDEFINES you put: SPINNER MIN X MAX AND

A Spinner is a bar of vertical scroll associated to an only get and it is good to increase or to diminish the value of the variable assigned to the get. This way, in a get with Spinner can introduce the fact manually or to press their scroll to modify it. Since the supreme spinner or it subtracts to the variable of the get, he/she only makes sense in numeric gets or of date.

16.-Problems with Ñ and ñ (mayusc. and min )
 Treatment a file .dbf that was created from Dbase Iv two in a program fivewin and clear ñ so you
they visualize as "Ñ" for what I apply OemToAnsi and orderly. But eun
díalogo of looking for for name wants that the operator types Ñ and it looks for it.

The case is that after proving several things the only form that I make that me
work it is the following one, but I don't understand BECAUSE it WORKS!

1:  Replacement in the original file the fields with Oem to Ansi

Do while .not. eof()
     letters - > letter: = OemToAnsi (letters - > letter)
     letters - > apelli: = OemToAnsi (letters - > apelli)
     letters - > it names: = OemToAnsi (letters - > it names)
     letters - > apenom: = OemToAnsi (letters - > apenom)
     skip
enddo

2.- I believe the index using AnsiToOem
 BuildIndex (oMeter, oText, oDlg, @ lEnd, "AnsiToOem (Letters - > Apenom)",
"AAPENOM" ) },;
          "Indexing base of Taxpayers without codes", "Wait a
moment" )

3.- The ListBox has to apply him/her: AnsiToOem
@ 1, 1 LISTBOX oLbx FIELDS
AnsiToOem (Letters - > letter), AnsiToOem (Letters - > apenom), STR ((Letters - > level) ,2);

4.- To the get I don't make him/her any conversion:
if MsgGet (to "LOOK FOR", "Last names.:", @ cApenom,;
              "lupa.bmp" )
      cClave: = Upper (cApenom)

For sure it is easier than all this, but it works!!!




17.-taenia a small function that showed in screen a text and it displaces it from izq to der and of
 up to below, this uses it to dress to the program nothing else but
I have the restlessness you this one can make and I eat,

In it paginates it of Ramón Avendaño you have the Class DSay That makes it exactly
that your you want.
http://personales.mundivia.es/rar/fivewin.htm



>
18.-In connection with the topic of the resources:
1) SCREENS.DLL that comes with FW 2.0 pretends to already have some problem
that I could never add him/her resources. The only solution to begin with
Empty DLL was to take a 'borrowed' that worked and to erase him/her all the
resources.
2) the other form of using resources, incrusting them in .EXE, you
it can sum up for the method that BUILD.BAT teaches or, according to
I discovered in BLINKER 5.1 to add in the link script the command RC
RECURSO.RES
you are right, to my An even sends me Lin a screen.dll
empty and he/she doesn't go, you cannot record anything in her

I believe that the reason for which goes when you add him/her resources to a full one it is
because they have something but, empty a good one, and when opening it with Sep resources
I opened up her alone the ct3dv2 (or something like that)
putting the resources by means of a rc and telling him/her to record as fos.dll
(llenita) he/she told me that it already existed, me the sobreescribia with my resources and
voilá!!  alone they are my resources and the other thing (mystery)


19.-We all have the prg calendar that he/she comes in samples
You put it alone and it works, I call it from my routine and anything, neither with
parameters neither without parameters,

Compile it and you call it from your program with Winexec ("calendar")
to have if it works this way you. and it works!!!1

20.-instead of Run you Have to use the function of FiveWin WaitRun()
But he/she has some strange things...
if you want that he/she appears you the possible message of the window and that this he/she doesn't close
you use it to hair "
WaitRun ('miprog')
But if quuieres that alone it executes it to you and later you comes out, easy, (when one knows)
WaitRun ('command.com /c miprog')


21.- Static variables This because a friend from Brazil wondered envelope for that of his GPF in a great application The problem was in STATIC. The friend used variable many STATIC for PRG, thing that FW supports in smaller quantity regarding MSDOS. Equally NEVER serious necessary to write but of 1 variable for I modulate PRG, let us see the example:

It is not convenient to make this!!!!!!!!
STATIC aVar
STATIC bVar
STATIC cVar
STATIC dVar


This should be made!!!!!!!
STATIC aArrayVars: = {Nil, Nil, Nil, Nil}
#xtranslate aVar = > aArrayVars \ [1 \]
#xtranslate bVar = > aArrayVars \ [2 \]
#xtranslate cVar = > aArrayVars \ [3 \]
#xtranslate dVar = > aArrayVars \ [4 \]

In fact with this we define 1 variable STATIC and we consume less the resources of the system, and this solution AVOIDS to modify the code of PRG, except the initial definition, and him but important EVITA GPF!!! Some will say that it is the same thing to put #it defines, BUT it IS NOT THE SAME thing!!!!!!!!, since these you are defined they don't solve when they incorporate in COMMANDS, thing that if it solves #xtranslate. :-)

    Now regarding PUBLIC. It is also convenient to use 1 (ONE) variable in the whole system. ...... Siiiiiiiiiiii is well also amarretes and greedy persons for the use of these, and we will avoid headaches and conflicts!!!!! Supognamos that we have the following variables:

PUBLIC cSistema: = "System Pepe"
PUBLIC cPath: = "\Datos"
PUBLIC cCopyright: = I "Collide Gigio Systems"

....... NOT NOT AND NOT!!!!! NON DEBEBMOS TO MAKE THIS!!!!!

We should make this another:

Function Main()
    PUBLIC oApp: = TApplication()
.......

return nil

CLASS TApplication
   It DATES cSistema INIT "System Pepe"
   It DATES cPath INIT "\Datos"
   It DATES cCopyright INIT I "Collide Gigio Systems"
    ........... and this way all those that we wanted!!!!! :-)
ENDCLASS

........... and like it is an object I publish we will be able to modify their instance variables when you we of the one given win!!!!! and we have 1 single public, bony oApp in object form and we would consent this way
    Alert (oApp:cCopyright)!!!!!!!!!! it is very easy!!!!!!!!!!!!!!!!!


    The shift arrives of the you DEPRIVE YOURSELF, it is convenient not to USE THEM we always use the LOCAL one and pasemolas for reference. We could also use a LOCAL I object TARRAY and this it is good us to pass arguments hundred of varialbes in 1 alone. OLVIDEMONOS qure exists the you DEPRIVE YOURSELF!!!!!
   
    CONCLUSION: If we optimize the code of an application we will achieve:

1) bigger speed
2) bigger resursos readiness
3) smaller errors GPF (they will be almost impossible of visualizing)
4) a code but readable



22.- A very good form of arming all the controls is to put him/her the clause UPDATE
This way you make the changes of the variables and single tenes that to make oDlg:update()
and I list he/she refreshes all the I dialogue.





23.- so that you cannot publish the get you should put the condition WHEN .F.

24.-as putting color to the static text?


> Dear friends like one makes to put color to the static generated text
> from Work Shop. Can one make from code?
> At the moment for SAY it REDEFINES them I use
> SAY oMunicipi REDEFINES VAR cCMunici you GO 122 OF Odlg UPDATE;
>    COLOR RGB (000,000,255), RGB (255,255,255)
>
> But if I generate a head text to the field from Work Shop not you
> to change him/her the color. Is it possible?

You make it from a same way to the example that you sent, alone you make sure that the one
text doesn't have you GO -1 but a you GO been worth.

25.-ENTER behaves like in Clipper-DOS.

If to you you are not behaved this way, then he/she enters to WS, and in the dialogues, him
you put to each button (in their properties), PUSH BUTTON instead of DEFAULT PUSH
BUTTON.

26.-checkbox.
 If you want that a logical variable changes state you don't use:
if (vclival=.t.,vclival:=.f.,vclival:=.t) it is but easy and but I clean to use:
vclival: =!vclival, this way forgets the questions.... ;)
2) the vclival value changes depending on the checkbox state. .... I don't see
so that you change it vos in the program.
PS: You have a VERY SIMPLE example IN SAMPLES\TESTCHCK.PRG

the error seems to be in that the variable vClival
it is changed alone, and if your in the program changes it, then
it returns to the same thing.

attempt this way it:

ON CLICK (TO CHANGE ('CLIENTS', 'CLI_VAL', IF (VCLIVAL, 'IF', 'NO') ) )



27.- > Matter: [fivewin-the] somebody knows about some agent type dbu for windows
> that it uses cdx??
>Prometheus of Daniel Andrade (Free)
http://www.dbwide.freeservers.com/


28.-Alignment in the numeric gets
In it paginates it of René Flores (Cibertec) a tips section he/she comes for
fivewin. I have descended several, I recommend it to you to all
According to TO THE, the solution was: besides telling him/her right alignment, the one
to declare the get like multilinea
He/she doesn't have logic but it works. before it was hideous
Publishing the I number it leaves well, with the comma and other


29.-Here addresses go where you prune to get manuals and information in
general on FiveWin.
http://Olivares2000.WebHostMe.com/ Group Olive groves 2000
http://here.as/FiveWin/ Patrick Mast's FiveWin Page
http://start.at/edf "E.D.F" of Tricks
http://members.tripod.cl/fivewin chili Fivewinweros
http://personales.mundivia.es/rar/
http://teleline.terra.es/personal/ravendano/SOBREFW.HTM Has more than enough FiveWin
http://users.fast.co.za/~georgem/ George's Little Web Page
http://www.aglsl.com/cincowin/ Five Win, the house of the one
programmer in Fivewin
http://www.aulaware.com/ FiveWin
http://www.ciber-tec.com/ Cibern&eacute;tica and
Tecnolog&iacute;a, CORP. of C.V Home Page
http://www.come.to/manuales
Http://www.eclipse.com.mx/web/fivewin/ Directory of / web / fivewin/
http://www.fivetech.com/ Fivetech: Xbase technology
http://www.grafxsoft.com/ GrafX Software CA Microsoft
Imprise Development Tools
http://www.htcsoft.freeservers.com/ htcsoft
http://www.olsonsoft.co.nz/ The Olson Software Web Site
http://ourworld.compuserve.com/homepages/jbott James Bott -
Intellitech - Computer Consulting for Small Business
http://www.argcon.net/manual5w/ is a recently gone up manual

In my place you also prune to lower a generator of applications, WiseCoder.
(This in development)
My place: http://www.citynet.com.ar/verger/wisecoder.htm

30.-Problems with printer
when the operator requests a listing, I generally put him/her
printersetup () so that it can select printer, paper or what was,
I think that the Button to cancel is not to Cancel" the impression, but it stops
To cancel the action of having taken another paper type, or another printer, in
the one dialogues of Printersetup ().
I make this way it:
An I dialogue of capture of data (the range of dates), with 3 bellboys:
A button OK (that shoots the impression)
Another button Setup that Printersetup () will shoot (but without
to print).
And another Button of Canceling (this if it cancels the listing).
If the user wants to change the size of the paper, for example; then
1ero. Setup pulses. After changing, the program presents him/her the one again
I dialogue previous, and OK pulses to print.

:

31.-But on static
    Yes that works: I already know that executable sentences cannot be placed
outside of the functions or procedures. The solution for a static variable
external it is the following one:

static aArrayVars

FUNCTION Main()

      DEFAULT aArrayVars: = Array (30 )

RETURN NIL

32.-The dialogues are not come created in WS.
I neither could read the I dialogue 12 (the 9 if I saw it well), and that made it was
to export it
to DIAL12.RC (resource / save resource ace /) and it publishes it with a text editor
and I gave myself
It counts that he/she brought a control VBX, it removes it, and then it cares him (FILE / ADD TO
PROYECT)
but before, change him/her the name of the resource (DIALOG_12 in .RC) so that not
repeat in your DLL.


33.-PROCESOR TABLE OVERFLOW. .....

> I am blocked in an I modulate of having indexed that taken out of the application and fact
> separated it works perfectly, indexing until the end has Already put him/her
> sysrefresh () for all the places and anything ....

These compiling with 5.2? If it is this way it is about linkear with ALLOC.obj. ....

> When compiling one of the prg he/she gives me memory overboked, but I compile it with lh
> clipper... and although he/she gives the error you doesn't come out, it continues until the one
> final ---

Some colleagues recommended not to use LH clipper, the reason is that it annuls
the message but continuous east!!  :((((


You have tripped yourself with the nightmare of most: PROCESOR TABLE
OVERFLOW. .....
Solution: There is not her.
The only solution is to remove the head files * .ch that you don't go to
to use.
As for example: Of fivewin.ch it removes:
OBDC.ch, DDE.ch, Tree.ch (if you don't use trees), etc.
And put: the #INCLUDE FIVEWIN.ch of I finish in each prg. ..................

> I have proven to recompilar with 5.3 and horror!!! the preprocesor table overflow
> that there was logado to remove by heart with a better handling of the variables,
> they return in all the modules, it negotiates worse the one preprocessed there is some
it forms
> of increasing him/her the memory of having preprocessed???

In 5.2 there is a lot but probability that this doesn't happen.
That is one of the reasons for which I continue using 5.2e.

Tenes that to eliminate Chs that you don't use, as placing these definitions
before FIVEWIN.CH, this the flame and this it is the form of annulling those
calls.

Another thing:
I recommend you that you arm prgs where they require calls you specify together.
For example:
impre.prg / / I defined this you work to print
this alone way here nesesitas for example REPORT.CH, and in the other ones not!!


34.- The problem also happened me.
the problem not you if it solves it but the dialogues are believed...

when it used for example the one

SEP RESOURCE TO "ELARCHIVO.DLL"
he/she always gave me the problem, but when I made it this way

SEP RESOURCE TO "C:\PROGRAMAS\...\ELARCHIVO.DLL"

it began to work, strange, if it indicated him/her the whole route it works and if
I don't give it to him the problem it arises.


35.-DLL's When changing of it schemes, tenes that to copy bwcc.dll to the directory
\windowsDir\system, is not necessary that you have it in another place.
You also have to have in that dir. ctl3d.dll, the one that comes with FW.
If tenes problems, it can be that some this with problems.

SEP RESOURCES TO
 loadlibrary ("bwcc.dll")
SEP RESOURCES TO "MENU.DLL"

36.-Handling of sources >
> @ 7, 13 Paid CHECKBOX PROMPT to "Pay & it Cares" ;
>         OF oDlg

it proves this:

        Pagado:SetFont (oWnd:oFont)

or even this another:

        Pagado:SetFont (oDlg:oFont)

Does the one define by the way, of the oDlg the referenciastes to the oWnd? That is to say him
you made similar to this:

DIALOG oDlg DEFINES OF oWnd

Otherwise I believe that the oDlg doesn't take as oFont that of the oWnd.

37.-filters inside your indexes (scopes)
you can use the clause Select of the command @... ListBox, the one which you
he/she allows to make filters
inside your indexes (scopes). It is something as :

@ 1,1 ListBox oLbx ;
FIELDS Clients - > It Names, Clients - > Debt ;
HEADERS "Names", "Debt" ;
FIELDSIZES 100,400 ;
SELECT Names FOR "America" TO "Pedro"
OF oDlg

38.- And one of the best...
Fivewin didn't work 2.0; he/she said that it lacked a function
I go to fivewin.lnk change the search for lib and!work!!!
That is to say that it is sometimes necessary to make the opposite of what you/they say. ....

39.- Trucar the valid.
In a routine of I calculate I need to make some calculations with some numeric gets; the on change doesn't work, the valid "is not worth" since I cannot use parameters; solution, intermediate, to use parts of one and another:

  GET gDIV_LITOT REDEFINES VAR vDIV_LITOT you GO 122 OF odlg PICTure "@ AND 99.999999" update READONLY / / for the result


   GET gDIV_LIRAS REDEFINES VAR vDIV_LIRAS you GO 102 OF odlg valid (vDIV_LITOT: = vDIV_LIRAS / vDIV_LICAM, odlg:update (), .t. ) // operation
notice .t. after update ()!!  This is the trick!!!
You can use valid with commands, without functions

   
*************** RESPECT THIS, PLEASE **********************************
Main authors of these tricks:
Juan José Machado. José Enrique Serrano Foundling, Fabián Acevedo, Antonio Linares, Luciano Cedrés, Hernán, Marcelo Montenegro, Martin Gómez Reyes, Guillermo Verger
Eduardo Rizzolo, Félix Pablo Big Fields, Fredy, The Full

and many but... Me alone I have limited myself to ask things and to pick up them
Angel Martin (Bilbao.-Spain)