Error : Missing ';' in 'variable declaration' but i have it

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"

#include "Engine/DataTable.h"

#include "Item.generated.h"

class UDataTable;

USTRUCT(BlueprintType)
struct FItemStruct : public FTableRowBase
{
	GENERATED_BODY()

	/** Item static mesh **/
	UPROPERTY(EditAnywhere, BlueprintReadOnly)
		UStaticMesh* ItemMesh;

	/**Item description**/
	UPROPERTY(EditAnywhere, BlueprintReadOnly)
		FString Description;
};

UCLASS()
class MYPROJECT3_API AItem : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AItem();

	UPROPERTY(VisibleAnywhere, blueprintReadOnly, Category = "Item")
		UStaticMeshComponent* MeshComp;
	
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "DataTable")
		UDataTable* MyCustomDataTable;

	UPROPERTY(EditAnywhere, blueprintReadOnly, Category = "DataTable")
		TArray<FName> DataValue(UDataTable Data);

protected:


public:	


};

Inventory/Item.h(44): error : Missing ‘;’ in ‘variable declaration’ but i have! What wrong?

You have added a parameter to the property in line 44.

TArray<FName> DataValue(UDataTable Data);

Perhaps you meant to just make the DataValue Property like this?

TArray<FName> DataValue;

No, i want this parameter, i need to put in “Data” information abown data table that user add, and get Row names from that.

See, idea was that in Actor BP, in section “Data table” use gave a 2 property, Data table (MyCustomDataTable) and array of row nams (DataValue), so user after selecting a data table can select row name of needt item.

CPP code:

TArray<FName> AItem::DataValue(UDataTable Data)
{
	TArray<FName> DataValuer = MyCustomDataTable->GetRowNames();
	return TArray<FName>();
}

I know that i don’t need UPROPERTY for this but i need RowNames from data table will be here

https://bit.ly/3nZ6Xky

You can’t mark a function as a UPROPERTY.

i need to put in “Data” information
abown data table that user add,

This can be your UPROPERTY, letting the user input data in a standard detail panel.

and get Row names from that.

Afaik this can’t be done out-of-the-box, you’d need to write your own editor extension for this to happen. An easier way is to just have that outputted to your log window (just use UE_LOG) or to screen as debug text.

Hope that helps!

f

Like this

Ok, let’s say i make a Enum list, how to put this information into variable? Just like previous DT_RowNames, but now in will be contain Enum information/