Errores Pauscal - ¿Sugerencias?

Consultas sobre el lenguaje Pauscal

Errores Pauscal - ¿Sugerencias?

Notapor PowerDeath » Vie Mar 28, 2014 1:21 pm

Bueno, estoy creando una librería como para practicar mi código y llamadas a api.
Estaba probando un codigo y muchas veces saltaba un cartel de error.
Imagen

También sale el famoso "Error interno del compilador"

Al utilizar la sentencia "Si" con el valor Null o #0

Si no les sale el cartel a la primera ves vuelvan a ejecutar el código.

Codigo:

Código: Seleccionar todo
Importar "pauscal.prp"

'###############################################################################################################################################
'Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Proc FindWindow(Referencia lpClassName,lpWindowName:Cadena):Entero, "User32.dll" "FindWindowA"
'Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Proc GetWindowTextLength(hwnd:Entero):Entero, "User32.dll" "GetWindowTextLengthA"
'Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Proc GetWindowText(hwnd:Entero,Referencia lpString:Cadena,cch:Entero):Entero, "User32.dll" "GetWindowTextA"
'Private Type POINTAPI
'    X As Long
'    Y As Long
'End Type
Estruc POINTAPI,X,Y:Entero
'Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Proc GetCursorPos(Referencia lpPoint:POINTAPI):Entero, "User32.dll"
'Private Declare Function WindowFromPoint Lib "user32" (ByVal xpoint As Long, ByVal ypoint As Long) As Long
Proc WindowFromPoint(xpoint,ypoint:Entero):Entero, "User32.dll"
'Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClass As String, ByVal nMaxCount As Long) As Long
Proc GetClassName(Referencia hwnd:Entero,Referencia lpclass:Cadena,Referencia nMaxCount:Entero):Entero, "User32.dll" "GetClassNameA"
'BOOL WINAPI SetWindowText(
'  _In_      HWND hWnd,
'  _In_opt_  LPCTSTR lpString
');
Proc SetWindowText(HWND:Entero,lpString:Cadena):Booleano, "User32.dll" "SetWindowTextA"
'BOOL WINAPI SetWindowPos(
'  _In_      HWND hWnd,
'  _In_opt_  HWND hWndInsertAfter,
'  _In_      int X,
'  _In_      int Y,
'  _In_      int cx,
'  _In_      int cy,
'  _In_      UINT uFlags
');
Proc SetWindowPos(hwnd,hWndInsertAfter,X,Y,CX,CY:Entero,uFlags:Word):Booleano,"User32.dll"
'###############################################################################################################################################

Clase PscVentanas,LongitudText,HWNDA:Entero

Privado:

Proc ObtenerLongitudTituloVentana(HeadleA:Entero)
Si HeadleA = 0 Entonces
   Mensaje("Error - El puntero o 'Headle' no puede ser nulo",48,"Error")
SiNo
   LongitudText = GetWindowTextLength(HeadleA)
FinSi
FinProc

Proc DevolverLongitudTituloVentana:Entero
Si LongitudText <> 0 Entonces Devolver LongitudText
FinProc

Proc Puntero:Entero
Si HWNDA <> 0 Entonces Devolver HWNDA
FinProc

Proc SetPuntero(Punter:Entero)
Si Punter <> 0 Entonces HWNDA = Punter
FinProc

Proc EstableserTexto(lpStringA:Cadena)
Var StatusWin:Booleano
Si HWNDA <> 0 Entonces
   Si CadLong(lpStringA) <> 0 Entonces
      StatusWin = SetWindowText(HWNDA,lpStringA)
         Si StatusWin = Falso Entonces Mensaje("Error al intentar cambiar el titulo.",48,"Error")
   FinSi
FinSi
FinProc

Proc LeerTitulo:Cadena
Var LetrasBuffer:Cadena,WindowTitle,i:Entero
Si HWNDA = 0 Entonces
   Mensaje("Error - El puntero o 'Headle' no puede ser nulo",48,"Error")
SiNo
   ObtenerLongitudTituloVentana(HWNDA)
   Contar i = 0 a LongitudText
   LetrasBuffer = LetrasBuffer + "X"
   Seguir
   WindowTitle = GetWindowText(HWNDA,LetrasBuffer,LongitudText + 1)
      Si WindowTitle <> 0 Entonces Devolver LetrasBuffer
FinSi
FinProc

Público:

Proc Buscar(VentanaNombreWindows:Cadena,Opcional NombreDeClase:Cadena = "") ' Obtiene el HWND de la ventana por su nombre.
Si VentanaNombreWindows = Null Entonces
   Mensaje("Error - El nombre de la ventana no puede ser nulo",48,"Error")
SiNo
   HWNDA = FindWindow(NombreDeClase,VentanaNombreWindows)
FinSi
FinProc

Prop Titulo:Cadena
Lec:LeerTitulo
Esc:EstableserTexto
FinProp

Prop HWND:Entero
Lec:Puntero
Esc:SetPuntero
FinProp

Prop ObtenerLongTitulo:Entero
Esc:ObtenerLongitudTituloVentana
Lec:DevolverLongitudTituloVentana
FinProp

FinClase

Var Ventana:PscVentanas

Crear Ventana

Ventana.Buscar("Pauscal")
Ventana.Titulo = "Hola Mundo"

¿alguna sugerencia para evitar estos errores?
Saludos!
Imagen
PowerDeath
 
Mensajes: 160
Registrado: Sab Ago 11, 2012 5:29 am

Sponsor


Re: Errores Pauscal - ¿Sugerencias?

Notapor ErikH » Sab Mar 29, 2014 6:29 am

Tal como está, me funciona sin problemas.

Lo probé con cmd.exe y el comando title Pauscal. Dejaría un GIF pero es muy noche. :lol:

PowerDeath escribiste:Al utilizar la sentencia "Si" con el valor Null o #0


si te refieres a la siguiente linea.

Código: Seleccionar todo
Si VentanaNombreWindows = Null Entonces


Pienso que sería mejor compararlo con una cadena vacía.

Código: Seleccionar todo
Si VentanaNombreWindows = "" Entonces


Porque por ejemplo si lo llamas así :

Código: Seleccionar todo
Ventana.Buscar(,)
Ventana.Buscar(,"una_clase")


El compilador genera un error. Ya que el primer argumento no es opcional.

Pero si lo llamas:

Código: Seleccionar todo
Ventana.Buscar("")


No mostrará ningún error. Y creo que no es lo que quieres porque le agregaste un mensaje en caso de que VentanaNombreWindows sea nulo/vacío. Yo le agregaría también el primer parámetro como opcional, y que el mensaje aparezca cuando los dos argumentos están vacíos, porque es muy raro buscar nada (=pp) .

También recuerda que cuando le pasas una cadena vacia a FindWindow() no es lo mismo que pasarle un Null ó 0.
ImagenEntrá a la wiki en OpenShift
Colofox!!!!
ErikH
 
Mensajes: 151
Registrado: Jue Nov 29, 2007 11:24 pm
Ubicación: Algún lugar de México

cheap jerseys wholesale 0-11-0-11-234660 cheap football jers

Notapor edEfyBQlAG » Sab Abr 28, 2018 11:25 pm

If you're drafting in the mid to late first don't be scared to take Gordon, and if he keeps slipping into the tail end in snake drafts as he has done the last couple of seasons he can keep being a great value pick.. In Too Deep is the most moving pop song of the 1980s, about monogamy and commitment.

That means that if you fail to raise the issue before the Judge, he or she will not dismiss the summons. The worst RAW in history occurred on the October 3rd edition of it's show when the ratings fell below a 1.8. Its huge 3D players (?la GameDay) running, diving, and even juking around my monitor brought pure bliss to the dozens that had sidled up to my desk to watch the pigskin fly.

cheapjerseys The "complainers" actually did a great job fighting this and won in court. Dodge muscle cars were among the fastest and wildest. Open, at age 22, but his greatest success came in the early to mid 1920s. But everybody is trying to Alter what god If kids have crooked teeth you know increases. cheapjerseys

"Ideologies address, fascinate, worry, and fix social subjects in ways appropriate to the reproduction of a given social order; they present as obvious, simple, and universal as reality itself what is peculiar, complex, and historically specific." (James H.

cheap nfl jerseys Considering all things and how things worked out after he left it is not fair, not fair at all to say he underperformed with his squad.in his first season he had 78 points at the end of the season (only 34 games in the bundesliga) which is the second best for dortmund ever and that was bouncing back from klopps p7 finish the season before. cheap nfl jerseys

cheap mlb jerseys Although the actual number of couples choosing to get married has fallen in recent years, those that do elect to tie the knot are increasingly favouring a wedding abroad. While yes, I am young, I do not believe that age determines your mental capacity to understand the issues and controversies our country is facing today. cheap mlb jerseys

It not a story the Jedi would tell you. I have done a little bit of all of that, started pulling cable for $10/hr when I was 18. In the case of grandparents, many families neglect to involve them in other family activities such as school competitions and events or other activities such as a day trip or vacation.

cheap chian jerseys But economics is not science: it is propaganda for the corporate sector. As a session drummer for Chess Records, he played on records by such notables as Etta James and Fontella Bass. 2. The Raider is air cooled. One way germs are transmitted from one person to another is through sneezing and coughing. cheapjerseys

cheap nba jerseys Then give it a stir and look at the consistency. Maybe we should march on Washington and demand our proper status.. Watch the guys on Around the Horn or Screamin A. I honestly expected to hate the live action only because I generally dislike the concept of making long series into film length features. cheap nhl jerseys

I think we make an excellent team together. In verse 27 God says "The spirit of man is the candle of the LORD, searching all the inward parts of the belly" God reveals how he has put in every person a candle. Aside from the occasional sirens because there is a hospital not too far away and ambulances chill along Hoyt Street waiting for a call, it isn anything out of the ordinary.

When the birds become a nescience in Florida they are often trapped and sent to farms. For example, while swimming and track races tend to run along the same lines, winning a gymnastics or figure skating event is very different from winning a sprint..

cheap nba jerseys The list goes on. You may be asking yourself, What screen size do I need for my room? Here is a simple guide to follow that will work in most any situation giving you the optimal projection screen size:. On heroes that it will that's due. And at the end of three months, under a microscope, the skin appeared at least 25 years younger. cheap nba jerseys

wholesale jerseys I sure many people would say Brent is lovely and gracious, and they right too. On this step we also see wich elbow goes with what. It an entire CFL region harassing one person for years for no reason and is now completely fed up with it and legit scared wholesale jerseys.
edEfyBQlAG
 
Mensajes: 558
Registrado: Jue Abr 26, 2018 11:34 pm

wholesale jerseys 0-19-0-19-239006 cheap nhl jerseys

Notapor edEfyBQlAG » Dom Abr 29, 2018 1:45 am

And then the guy asked for the T shirt to make up for it, and then Rubin gave it to him and joked that he had to.. For disabled accounts, like root, there is no hash stored. However, I neither knew how long it would take for my pension claim to pay out, nor was I aware of the UIF [Unemployment Insurance Fund] payout process, says Sipho, who, although being told he would receive his pension payout within a month, is still waiting to be paid.

cheap nhl jerseys League is a casual format, so play what you want. Like you said, you could probably get away with 30 to 40 seconds before it would start to kill you. Her worried family pleading for help. Little by little, he improves. Maybe I'm too cynical but I see it all as a PR campaign. cheap nhl jerseys

cheap ncaa jerseys People who live in places that have higher levels of background radiation than normal, such as Denver, Colorado, with levels above 10 millisieverts per year, have not shown adverse biological effects, the NRC said. He looked to be in a hurry. When having a leg injury of some sort you tend to keep off it which can lead on to your other leg being overused which can either put a lot of strain onto it or lots of muscle which then impacts on your injured leg when it heals because of bad muscle balance.Past injuries also are classed as an intrinsic risk factor. cheap jerseys wholesale

wholesale jerseys china She if she wins she made him the first. Where the Democrats gained two senate seats and 8 house seats.. The Texas Rat Snake, Also Called A "Chicken Snake"Now the picture above is not my own, and the reason I do not have my own pictures of the large rat snake that gave me a bit of a thrill and a silly Facebook status thing to post is because snakes are somewhat exciting. cheap nfl jerseys

cheap mlb jerseys They not giving into every demand, but they listen and do change their products because of it. After the heavy losses in the field, Rall ordered a forward advance towards Washington and his flank up on higher ground. James Tavernier played him onside as the rest of the Rangers defence came out, giving him time and space to knock the ball across the face of the goal for Erskine to slide in and score.. cheap nfl jerseys

Was underwhelmed. And they gave thanks each time they took and asked the spirits of that which they took to give their gifts with blessings. Having long admired the thunderbird motif in murals and on totems, it's interesting to learn of its symbolism too.

JT is ready and waiting at the plate and this has the set up for a nasty collision. If you shank a ball, just take a peek down at your feet and look at your arms to see what position you were in and how to better correct it next time. It could be replaced with natural foie gras, and while supply would initially be very low, it would be just fine.

cheap jerseys It a vehicle that costs several thousand dollars, then you have to trailer it to the races, buy tires, fuel, replace broken parts.. I have know men that beat their women, mothers that beat and emotionally abuse their children but at church, work and around friends and family, they are on their best behavior. cheap jerseys

1 women's tennis player who has also been featured as a model and spokeswoman. Although they are commonly known even today as the Salem witch trials, trials occurred in other towns throughout the colonies. Her determination and goal was to reform the Carmelite Order and revive the early strict rules that had gone lax over the years.

cheap jerseys wholesale It just wasn really a big thing around home, because (as I found out much later) my mom was vegetarian. I am completely understanding of the phenomenological approach that truth and reality are purely subjective. My door was wide open, and my baby's gone. cheap jerseys wholesale

wholesale football jerseys When I was in the fourth grade, we had the option of picking a class that we wanted to do for fun such as cooking, art, or a music class. Don't just flex to comp, flex to map too. Broadly, World War One songs can fall into several categories:Barrack Room SongsOne of the most popular songs of the war was "It's a Long Way to Tipperary", the story of a young Irishman who leaves his best girl behind to find his fortune in London wholesale football jerseys.
edEfyBQlAG
 
Mensajes: 558
Registrado: Jue Abr 26, 2018 11:34 pm


Volver a Dudas, Preguntas y Respuestas

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 2 invitados

cron