עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

הסבר בבקשה לקוד קצר בDelphi

Featured Replies

פורסם

זה הקוד:

Procedure TForm2.DBGrid1TitleClick(Column: TColumn);

{$J+}

const PreviousColumnIndex : integer = 1;

{$J-}

begin

if DBGrid1.DataSource.DataSet is TCustomADODataSet then

with TCustomADODataSet(DBGrid1.DataSource.DataSet) do

begin

try

DBGrid1.Columns[PreviousColumnIndex].title.Font.Style :=

DBGrid1.Columns[PreviousColumnIndex].title.Font.Style - [fsBold];

except

end;

Column.title.Font.Style :=

Column.title.Font.Style + [fsBold];

PreviousColumnIndex := Column.Index;

if (Pos(Column.Field.FieldName, Sort) = 1)

and (Pos(' DESC', Sort)= 0) then

Sort := Column.Field.FieldName + ' DESC'

else

Sort := Column.Field.FieldName + ' ASC';

end;

end;

הפרוצדורה עובדת מצוין, היא אמורה להפעיל sorting על עמודות בDBGrid ע"י לחיצה על Titles.

הבעיה שלי היא שאני לא מבין את השימוש בpos וב"משתנה" sort, אשר בכלל לא מוגדר.

אם יש פה מישהו שמבין/ה את הקוד, בבקשה השאירו לי הסבר קצר.

תודה מראש, קובי.

פורסם

אני מנחש ש- sort זה משתנה שמוגדר על ה- form ואמור להכיל את החלק של מחרוזת ה- SQL שמטפלת בסידור.

pos זאת פונקציה של פסקל שמחזירה לך את מיקום המחרוזת הראשונה בתוך המחרוזת השניה, ו- 0 אם היא לא שם.

כשמקליקים על הכותרת של העמודה, הפרוצדורה מחפשת את השם של השדה במחרוזת ההסידור.

אם הוא שם וגם הסידור הוא בסדר עולה אז היא הופכת את הסדר, אחרת - היא מסדרת בסדר עולה לפי השדה.

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.