Bonjour,
j'ai un souci avec des pointeurs , je dois récupérer des libelllés pour les afficher dans des tlmdShapecontrol, cependant j'ai un message d'erreur qui bloque ma procedure.
message : impossible de convertir le variant (Null) en type (String).Voici le bout de code impliqué:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
 while (not eof) do
    begin
   // MessageDlg('entrée boucle parcours', mtWarning, [mbOK], 0);
      if (nextSectionDisp<8) then
      begin
     //   MessageDlg('Cas où nb Categ <= 8', mtWarning, [mbOK], 0);
        nextSectionDisp:=nextSectionDisp+1;
        codeSectionUniq:=FieldByname('CODPAR_SECTION').Value;
       // showmessage(codesectionuniq);
        //MessageDlg('nbControls= '+Inttostr(gb_plat.ControlCount-1), mtWarning, [mbOK], 0);
        for i:=0 to gb_plat.ControlCount-1 do
        begin
        // MessageDlg(IntToStr(i)+'ème Parcours des boutons Categ', mtWarning, [mbOK], 0);
          if gb_plat.Controls[i] is TLMDShapeControl then
          begin
            if (gb_plat.Controls[i] as TLMDShapeControl).name = 'b_s_'+inttostr(nextSectionDisp) then
            begin
             MessageDlg('Le bouton '+IntToStr(i)+' sélectionné est celui à afficher', mtWarning, [mbOK], 0);
              with (gb_plat.Controls[i] as TLMDShapeControl) do
              begin
              //  Caption.Caption := String(FieldByname('LIBSECTION').Value);
              //requete remplace ligne dessus
 
                        paraext2:=i;
                        showmessage(inttostr(paraext2)) ;
                        DMTactile.NewQry(Qry1);
                               with Qry1 do
                                  begin
                                  if active then close;
                                  Sql.Clear;
                                  sql.Add('select par_codtbl,par_lib as LIBSECTION, par_ext2');      //AS LIBSECTION
                                  sql.Add('from  parametres');
                                  Sql.Add('  WHERE    par_ext2=:paraext2 and par_codtbl=''CATEG''');           //order by par_ext2
                                  open;
                                    Caption.Caption := String(FieldByname('LIBSECTION').Value);
 
                                   end;
                                  Qry1.close;
 
 
             MessageDlg('Libellé='+String(FieldByname('LIBSECTION').Value), mtWarning, [mbOK], 0);
                Visible:=true;
                Font.Color:=clBlack;
                if tag <> 0 then
                  FreeMem(PProd(Tag));
                New (produit);
                produit^.id_tag:=SECTION;
                produit^.code_categ:=String(FieldByname('COD_SECTION').Value);
                tag:=Integer(produit);
              //MessageDlg('Tag= '+ IntToStr(tag), mtWarning, [mbOK], 0);
              end;
            end
          end;
        end;
      end
      else
        fini:=false;
      Next;
    end;
    DMTactile.DestroyQRY(QrySection);
     DMTactile.DestroyQRY(Qry1);
  end;
  ISBSDNUP(fini);
Si quelqu'un a eut une idée , elle sera super bienvenue. Merci .