Página 1 de 1

comando PROMPT não funciona 100% no Harbour

Enviado: 21 Dez 2016 00:53
por lugab
Boa noite, pesssoal..

A "mensagem" do comando PROMPT não funciona no Harbour 2.0 e nada é exibido.. Alguém tem um plano B ?

Código: Selecionar todos

@ 10,20 Prompt "Cadastro" message "Gerar novos titulos"

Código: Selecionar todos

syntax
      @ <nRow>, <nCol> PROMPT <cPrompt> [MESSAGE <xMsg>]
Arguments
<nRow> is the row number to display the menu <cPrompt>. Value could range from zero to MaxRow().
<nCol> is the column number to display the menu <cPrompt>. Value could range from zero to MaxCol().
<cPrompt> is the menu item character string to display.
<xMsg> define a message to display each time this menu item is highlighted. <xMsg> could be a character string or code block that is evaluated to a character string. If <xMsg> is not specified or of the wrong type, an empty string (“”) would be used.

comando PROMPT não funciona 100% no Harbour

Enviado: 21 Dez 2016 01:16
por alxsts
Olá!

Qual definição de tela está sendo usada (linhas e colunas)?

É necessário definir em qual linha da tela a mensagem deverá ser exibida. Está fazendo isto?

Veja exemplo extraído de CA-Clipper 5.3 . Guide To CA-Clipper - Norton Guide

Código: Selecionar todos

     .  This example shows how to pass the MESSAGE clause a code block
        which calls a user-defined function that displays a message in a
        different color:

        SET COLOR TO gr+/b,r+/n
        SET MESSAGE TO 23    // This is necessary.*******************
        CLEAR SCREEN

        @ 3,4 PROMPT "one "  MESSAGE {||UDF("Message One  ")}
        @ 4,4 PROMPT "two "  MESSAGE {||UDF("Message Two  ")}
        @ 5,4 PROMPT "three" MESSAGE {||UDF("Message Three")}

        MENU TO test

        FUNCTION UDF(cParm)
        cOldColor := SETCOLOR("w+/n")
        @ 22,1 SAY cParm        // Must be different row than the
                                // SET MESSAGE TO nRow
        SETCOLOR(cOldColor)
        RETURN ""               // Character string must be returned

comando PROMPT não funciona 100% no Harbour

Enviado: 21 Dez 2016 01:49
por lugab
Perfeito, Alexandre, o problema era esse mesmo, faltava definir a linha. Muito grato...

Pena que a cor da mensagem não possa ser manipulada via comando "Prompt-Message" e assuma o setcolor() padrao.
Pra fazer isso na mão grande tem q estabelecero cores diferentes para antes e para depois de cada série de prompt

Código: Selecionar todos

setcolor(cor-A)
prompt ...
prompt ...
prompt ...
Menu to ...
setcolor(cor-Padrao)